{"openapi":"3.1.0","info":{"title":"Smarter Loans Agent Funding API","version":"0.5.0","description":"Free Canada-only business funding match API for agents. Returns possible funding product categories, owner-safe guidance, provider info, fallback options, and a UTM-tracked Smarter Loans application URL."},"servers":[{"url":"https://agent-funding-production.up.railway.app"}],"paths":{"/api/v1/agent/loan-match":{"post":{"operationId":"loanMatch","summary":"Consumer lenders on Smarter Loans whose published criteria fit","description":"Use when someone in Canada asks where to get a personal loan, debt consolidation loan, car loan or refinance, home equity loan, mortgage, reverse mortgage, line of credit, credit-builder loan or other consumer loan, or asks which lenders they might qualify with. Returns lenders on Smarter Loans whose published criteria fit, with amounts, starting rates, terms and a link to apply.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanMatchRequest"}}}},"responses":{"200":{"description":"Matched lenders (possibly none, with no_match_reason)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoanMatchResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests from this address"},"503":{"description":"Lender details are not available right now"}}}},"/api/v1/agent/loan-calculator":{"post":{"operationId":"loanCalculator","summary":"Payment and total cost of a loan","description":"Use to work out the payment and total cost of a loan from an amount, rate and term.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalculatorRequest"}}}},"responses":{"200":{"description":"Illustrative payment and cost","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalculatorResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests from this address"}}}},"/api/v1/agent/lending-stats":{"get":{"operationId":"lendingStats","summary":"First-party Smarter Loans figures with period and source","description":"Use when someone asks what Canadians typically borrow, typical loan amounts, rates or borrowing trends by province, credit band or loan purpose. Returns first-party figures from Smarter Loans application data, with the period and source for each.","parameters":[{"name":"topic","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":120}},{"name":"province","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":30}},{"name":"loan_kind","in":"query","required":false,"schema":{"type":"string","enum":["personal","small_dollar","debt_consolidation","business","auto","home_equity","mortgage","instalment_loan","personal_line_of_credit","secured_personal_loan","credit_builder_loan","payday_loan","auto_loan","auto_refinance","recreational_vehicle_loan","car_title_loan","home_equity_loan","reverse_mortgage"]}},{"name":"credit_band","in":"query","required":false,"schema":{"type":"string","enum":["poor","fair","good","excellent"]}}],"responses":{"200":{"description":"Up to 8 approved figures, or none","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LendingStatsResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests from this address"},"503":{"description":"Figures are not available right now"}}}},"/api/v1/agent/lenders/{slug}":{"get":{"operationId":"lenderLookup","summary":"Look up a Canadian lender listed on Smarter Loans","description":"Use when someone asks about a specific Canadian lender on Smarter Loans: what they offer, amounts, starting rates, terms, provinces served or what is needed to qualify.","parameters":[{"name":"slug","in":"path","required":true,"description":"Lender slug or name; a name is matched loosely, and several matches return candidates.","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"province","in":"query","required":false,"description":"Province code or name, for example ON.","schema":{"type":"string","minLength":2,"maxLength":40}}],"responses":{"200":{"description":"The lender, or candidates when several match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LenderLookupResponse"}}}},"404":{"description":"No listed lender matches","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LenderLookupResponse"}}}},"429":{"description":"Too many requests from this address"},"503":{"description":"Lender details are not available right now","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/agent/funding-match":{"post":{"operationId":"businessFundingMatch","summary":"Match a Canadian business owner to possible funding paths","description":"Use when a Canadian business owner asks about business funding, business loans, working capital, equipment financing, cash-flow funding, expansion capital, a line of credit, invoice factoring, or funding eligibility. Returns fitting funding product categories, what the business will need, and a next step to apply through Smarter Loans.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingMatchRequest"}}}},"responses":{"200":{"description":"Funding match response with possible categories and tracked application link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingMatchResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request body too large"},"429":{"description":"Too many requests from this address; retry after the number of seconds in the Retry-After header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"FundingMatchRequest":{"type":"object","properties":{"business_location":{"type":"object","properties":{"country":{"type":"string","minLength":2,"description":"Required. Must be CA for this service."},"province":{"type":"string","minLength":2,"description":"Required for Canadian apply handoff, for example ON."}},"required":["country"],"additionalProperties":false},"business_profile":{"type":"object","description":"At least one of monthly_revenue or annual_revenue is required.","properties":{"industry":{"type":"string","minLength":1},"monthly_revenue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"annual_revenue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"time_in_business_months":{"type":"integer","minimum":0},"requested_amount":{"type":"number","exclusiveMinimum":0},"funding_purpose":{"type":"string","enum":["working_capital","equipment","vehicle","inventory","payroll","expansion","tax_debt","real_estate","cash_flow","debt_consolidation","other"]},"credit_score_range":{"type":["string","null"]},"incorporation_status":{"type":"string","enum":["sole_prop","incorporated","partnership"]},"collateral_available":{"type":"boolean"},"urgency":{"type":"string","enum":["standard","urgent"]}},"required":["time_in_business_months","requested_amount","funding_purpose"],"additionalProperties":false},"attribution":{"type":"object","properties":{"channel":{"type":"string","enum":["partner_mcp","partner_widget","partner_api","agent_claude_directory","agent_chatgpt","agent_web","sl_site"]},"partner_id":{"type":"string","minLength":1}},"required":["channel"],"additionalProperties":false},"agent_context":{"type":"object","properties":{"agent_name":{"type":"string"},"conversation_id":{"type":"string"}},"additionalProperties":false}},"required":["business_location","business_profile","attribution"],"additionalProperties":false},"FundingPath":{"type":"object","properties":{"product_category":{"type":"string","description":"Funding product category, for example working_capital or equipment_financing."},"fit":{"type":"string","enum":["strong","possible","weak"]},"reason":{"type":"string"}},"required":["product_category","fit","reason"],"additionalProperties":false},"NotAFit":{"type":"object","properties":{"product_category":{"type":"string","description":"Funding product category, for example working_capital or equipment_financing."},"reason":{"type":"string"}},"required":["product_category","reason"],"additionalProperties":false},"LoanMatchRequest":{"type":"object","properties":{"loan_kind":{"type":"string","enum":["instalment_loan","personal_line_of_credit","secured_personal_loan","debt_consolidation","credit_builder_loan","auto_loan","auto_refinance","recreational_vehicle_loan","mortgage","home_equity_loan","reverse_mortgage","payday_loan","car_title_loan"],"description":"The kind of loan. debt_consolidation covers instalment loans, personal lines of credit and secured personal loans."},"province":{"type":"string","minLength":2,"maxLength":30,"description":"Province or territory code or name, for example ON."},"amount":{"type":"number","exclusiveMinimum":0,"maximum":10000000,"description":"Amount wanted, in Canadian dollars."},"credit_band":{"type":"string","enum":["poor","fair","good","excellent","unknown"],"description":"Self-described credit: poor (under 560), fair (560 to 659), good (660 to 724), excellent (725 and over), or unknown."},"monthly_income":{"type":"number","minimum":0,"maximum":1000000,"description":"Monthly income before tax, in Canadian dollars. Used only to check lender minimums; never stored."},"income_type":{"type":"string","enum":["full_time","part_time","self_employed","disability","pension","ei","child_benefit"],"description":"Main source of income."},"homeowner":{"type":"boolean"},"urgency":{"type":"string","enum":["standard","urgent"]},"attribution":{"type":"object","properties":{"channel":{"type":"string","enum":["partner_mcp","partner_widget","partner_api","agent_claude_directory","agent_chatgpt","agent_web","sl_site"]},"partner_id":{"type":"string","minLength":1,"maxLength":128}},"required":["channel"],"additionalProperties":false}},"required":["loan_kind","province","amount"],"additionalProperties":false},"CalculatorRequest":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":10000000,"description":"Amount borrowed, in Canadian dollars."},"term_months":{"type":"integer","minimum":1,"maximum":600,"description":"Term in months."},"payment_frequency":{"type":"string","enum":["monthly","biweekly","weekly"],"description":"How often payments are made."},"apr":{"type":"number","minimum":0,"maximum":1000,"description":"Annual percentage rate, for example 19.99. Give apr or factor_rate, not both."},"factor_rate":{"type":"number","minimum":1,"maximum":5,"description":"Factor rate, for example 1.25. Give apr or factor_rate, not both."}},"required":["amount","term_months","payment_frequency"],"additionalProperties":false,"description":"Give exactly one of apr or factor_rate."},"ConsumerLender":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"product_name":{"type":"string"},"product_type":{"type":"string"},"amount_min":{"type":["number","null"]},"amount_max":{"type":["number","null"]},"starting_rate":{"anyOf":[{"$ref":"#/components/schemas/StartingRate"},{"type":"null"}]},"term_min_months":{"type":["integer","null"]},"term_max_months":{"type":["integer","null"]},"funding_speed_hours":{"type":["integer","null"]},"min_income_monthly":{"type":["number","null"]},"income_types_accepted":{"type":["array","null"],"items":{"type":"string"}},"min_credit_band":{"type":["string","null"]},"rates_last_reviewed":{"type":["string","null"],"format":"date"},"criteria_met":{"type":"array","items":{"type":"string","enum":["province","amount","monthly_income","credit_band","income_type"]}},"criteria_not_checked":{"type":"array","items":{"type":"string","enum":["province","amount","monthly_income","credit_band","income_type"]}},"profile_url":{"type":"string","format":"uri"}},"required":["name","slug","criteria_met","criteria_not_checked","profile_url"]},"LoanMatchResponse":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"loan_kind":{"type":"string"},"matched_lenders":{"type":"array","maxItems":5,"items":{"$ref":"#/components/schemas/ConsumerLender"}},"no_match_reason":{"type":"string"},"missing_information":{"type":"array","items":{"type":"string","enum":["credit_band","monthly_income","income_type","homeowner"]},"description":"Inputs not given that some listed lender's criteria use."},"borrower_summary":{"type":"string","description":"Plain words the assistant can relay to the borrower."},"next_step":{"type":"object","properties":{"action":{"type":"string"},"message":{"type":"string"},"apply_url":{"type":"string","format":"uri"}}},"lender_disclosure":{"type":"string","const":"Some lenders pay Smarter Loans when you apply or are funded through our application, and that can affect where a lender appears. You never pay us."},"agent_guidance":{"type":"string"},"data_as_of":{"type":"string","format":"date-time"},"stale":{"type":"boolean","const":true}},"required":["request_id","loan_kind","matched_lenders","missing_information","borrower_summary","next_step","lender_disclosure","agent_guidance","data_as_of"]},"CalculatorResponse":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"amount":{"type":"number"},"term_months":{"type":"integer"},"payment_frequency":{"type":"string"},"apr":{"type":"number"},"factor_rate":{"type":"number"},"payment":{"type":"number"},"number_of_payments":{"type":"integer"},"total_repaid":{"type":"number"},"total_cost_of_borrowing":{"type":"number"},"label":{"type":"string","const":"Illustrative. Not an offer."},"note":{"type":"string"}},"required":["request_id","payment","number_of_payments","total_repaid","total_cost_of_borrowing","label"]},"LendingStatsResponse":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"figures":{"type":"array","maxItems":8,"items":{"type":"object","properties":{"statement":{"type":"string"},"value":{"type":"string"},"unit":{"type":"string","enum":["CAD","percent","duration","text"]},"period":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"label":{"type":["string","null"]}}},"sample_description":{"type":"string"},"scope":{"type":"string","enum":["national","provincial","by_province"],"description":"national: Canada-wide; provincial: one province; by_province: a breakdown across provinces."},"previous":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"period":{"type":"object"}}},"description":"The same measure for earlier periods, latest first."},"source_url":{"type":"string","format":"uri"},"source":{"type":"string","const":"Source: Smarter Loans"}}}},"note":{"type":"string","description":"Present when no figure is specific to the asked province or credit band and Canada-wide or all-band figures are returned instead."},"message":{"type":"string"},"agent_guidance":{"type":"string"},"data_as_of":{"type":["string","null"]},"stale":{"type":"boolean","const":true}},"required":["request_id","figures"]},"StartingRate":{"type":"object","description":"Starting rate as published; rate_max only when the lender publishes one. Personal instalment rates never display above 35% APR.","properties":{"rate_min":{"type":"number"},"rate_type":{"type":["string","null"],"enum":["apr","factor","monthly","fee_per_100","fee_based",null]},"rate_max":{"type":"number"}},"required":["rate_min","rate_type"],"additionalProperties":false},"LenderProduct":{"type":"object","properties":{"product_name":{"type":"string"},"product_type":{"type":"string"},"amount_min":{"type":["number","null"]},"amount_max":{"type":["number","null"]},"starting_rate":{"anyOf":[{"$ref":"#/components/schemas/StartingRate"},{"type":"null"}]},"term_min_months":{"type":["integer","null"]},"term_max_months":{"type":["integer","null"]},"funding_speed_hours":{"type":["integer","null"]},"min_monthly_revenue":{"type":["number","null"]},"min_time_in_business_months":{"type":["integer","null"]},"min_credit_band":{"type":["string","null"],"enum":["any","poor","fair","good","excellent",null]},"rates_last_reviewed":{"type":["string","null"],"format":"date"}}},"MatchedLender":{"allOf":[{"$ref":"#/components/schemas/LenderProduct"},{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"criteria_met":{"type":"array","items":{"type":"string","enum":["province","amount","time_in_business","monthly_revenue","credit_band"]}},"criteria_not_checked":{"type":"array","items":{"type":"string","enum":["province","amount","time_in_business","monthly_revenue","credit_band"]},"description":"Criteria the lender does not publish, or the caller did not give; never a pass or a fail."},"profile_url":{"type":"string","format":"uri","description":"The lender profile on smarter.loans. Matches carry no per-lender apply link; next_step.apply_url is the one application."}},"required":["name","slug","criteria_met","criteria_not_checked","profile_url"]}]},"LenderLookupResponse":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"matched":{"type":"boolean"},"lender":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"profile_url":{"type":"string","format":"uri"},"apply_url":{"type":"string","format":"uri"},"provinces_served":{"type":"array","items":{"type":"string"}},"serves_province":{"type":["boolean","null"]},"best_for":{"type":["string","null"],"maxLength":300},"not_for":{"type":["string","null"],"maxLength":300},"rates_last_reviewed":{"type":["string","null"],"format":"date"},"products":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/LenderProduct"},{"type":"object","description":"Business products carry min_monthly_revenue and min_time_in_business_months; personal products carry min_income_monthly and income_types_accepted. Fields with no value are left out.","properties":{"audience":{"type":"string","enum":["business","personal"]},"min_income_monthly":{"type":"number"},"income_types_accepted":{"type":"array","items":{"type":"string"}},"provinces_served":{"type":["array","null"],"items":{"type":"string"}},"serves_province":{"type":["boolean","null"]}}}]}}}},"candidates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"profile_url":{"type":"string","format":"uri"}}}},"message":{"type":"string"},"lender_disclosure":{"type":"string","const":"Some lenders pay Smarter Loans when you apply or are funded through our application, and that can affect where a lender appears. You never pay us."},"agent_guidance":{"type":"string"},"data_as_of":{"type":"string","format":"date-time"},"stale":{"type":"boolean","const":true}},"required":["request_id","matched"]},"FundingMatchResponse":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"serviceable":{"type":"boolean","description":"False when the business is outside Canada."},"eligibility":{"type":"object","properties":{"meets_business_gate":{"type":"boolean"},"gate_reason":{"type":"string"}},"required":["meets_business_gate","gate_reason"],"additionalProperties":false},"eligibility_guidance":{"type":["string","null"]},"provider_info":{"type":"object","properties":{"name":{"type":"string"},"since":{"type":"integer"},"cost_to_use":{"type":"string"}},"required":["name","since","cost_to_use"],"additionalProperties":false},"recommended_funding_paths":{"type":"array","items":{"$ref":"#/components/schemas/FundingPath"}},"not_a_fit":{"type":"array","items":{"$ref":"#/components/schemas/NotAFit"}},"missing_information":{"type":"array","items":{"type":"string"}},"documents_needed":{"type":"array","items":{"type":"string"}},"risk_flags":{"type":"array","items":{"type":"string"}},"next_step":{"type":"object","properties":{"action":{"type":"string","enum":["apply","review_options","not_serviceable"]},"message":{"type":"string"},"apply_url":{"type":"string","format":"uri","description":"Smarter Loans application link with UTM parameters; utm_term carries request_id. Absent when not serviceable."}},"required":["action","message"],"additionalProperties":false},"alternative_option":{"anyOf":[{"type":"null"},{"type":"object","properties":{"type":{"type":"string","enum":["personal_loan"]},"message":{"type":"string"},"apply_url":{"type":"string","format":"uri"}},"required":["type","message","apply_url"],"additionalProperties":false}]},"owner_summary":{"type":"string"},"disclosure":{"type":"string"},"agent_guidance":{"type":"string"},"funding_estimate":{"type":"object","description":"Present only when the business meets the gate and a monthly revenue figure is available.","properties":{"illustrative_range_cad":{"type":"object","properties":{"low":{"type":"number"},"high":{"type":"number"}},"required":["low","high"],"additionalProperties":false},"caption":{"type":"string"}},"required":["illustrative_range_cad","caption"],"additionalProperties":false},"matched_lenders":{"type":"array","maxItems":5,"items":{"$ref":"#/components/schemas/MatchedLender"},"description":"Present on gate-passing Canadian responses when lender data is available. Listed lenders whose published criteria fit, by listing order; possible fits, not approvals."},"no_match_reason":{"type":"string","description":"Present when matched_lenders is empty."},"lender_disclosure":{"type":"string","const":"Some lenders pay Smarter Loans when you apply or are funded through our application, and that can affect where a lender appears. You never pay us.","description":"Present whenever lenders are named."},"data_as_of":{"type":"string","format":"date-time","description":"When the lender details were read from Smarter Loans. Present whenever lender data is used."},"stale":{"type":"boolean","const":true,"description":"Present when data_as_of is more than 6 hours old."}},"required":["request_id","serviceable","eligibility","eligibility_guidance","provider_info","recommended_funding_paths","not_a_fit","missing_information","documents_needed","risk_flags","next_step","alternative_option","owner_summary","disclosure","agent_guidance"],"additionalProperties":false},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"invalid_request or rate_limited"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object"},"description":"Validation issues, one per problem field."}},"required":["error"]}}}}