{"openapi":"3.1.0","info":{"title":"Tanzim API","description":"Turn raw card and bank transaction strings into structured merchant data.\n\n**Stability promise.** Everything under `/v1` is additive-only: fields are never removed, renamed or re-typed. The matching engine behind it improves continuously and `engine_version` tells you which build answered. Anything that would break a client ships as `/v2`.\n","version":"1.6.0"},"servers":[{"url":"/v1"}],"paths":{"/health":{"get":{"tags":["Meta"],"summary":"Liveness check","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/meta":{"get":{"tags":["Meta"],"summary":"Engine and data summary","operationId":"meta_meta_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Meta"}}}}}}},"/examples":{"get":{"tags":["Meta"],"summary":"Live example inputs and outputs","description":"Sample transactions run through the engine right now, so the output is always what the current build really returns. The docs pages are generated from this.","operationId":"examples_examples_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExamplesResponse"}}}}}}},"/keys":{"post":{"tags":["Keys"],"summary":"Create a test API key","description":"Self-serve and instant: no approval step. Returns the key once. Limited per IP address.","operationId":"create_key_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreated"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/me":{"get":{"tags":["Keys"],"summary":"Check your API key","description":"The quickest way to verify an integration: returns 200 if your key works.","operationId":"me_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/keys/current":{"delete":{"tags":["Keys"],"summary":"Revoke the key you are using","description":"Use to rotate: create a new key, switch over, then revoke the old one. Irreversible.","operationId":"revoke_current_keys_current_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Revoked"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/enrich":{"post":{"tags":["Enrichment"],"summary":"Enrich one transaction","description":"Identify the merchant behind a raw transaction string and return structured details.","operationId":"enrich_enrich_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichResponse"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/enrich/batch":{"post":{"tags":["Enrichment"],"summary":"Enrich many transactions","description":"Up to 100 transactions per call. Each item counts once toward your rate limit. Results are in input order; one unmatched item never fails the whole batch.","operationId":"enrich_batch_enrich_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/statements/analyze":{"post":{"tags":["Statements"],"summary":"Analyse a bank or card statement","description":"Upload a statement (PDF, CSV or Excel) and get back every transaction parsed, dated, classified and enriched with merchant details, plus insights: spending by category and merchant, monthly trend, recurring payments and subscriptions, transfers, fees and cash. The file is processed in memory and never stored. `statement.confidence` and `statement.reconciliation` tell you whether the parse can be trusted: if the statement has a balance column, every row is checked against it.","operationId":"analyze_statement_file_statements_analyze_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_statement_file_statements_analyze_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisResponse"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"The request body is too large (1 MB for most endpoints; statements may be larger, see /v1/meta).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"That file type isn't supported. Upload a PDF, CSV or Excel (.xlsx) statement.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The file was read but no transactions could be extracted (for example a scanned PDF, a password-protected PDF, or a file that isn't a statement). `details[].reason` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/transactions/analyze":{"post":{"tags":["Statements"],"summary":"Analyse a list of transactions","description":"Same enrichment and insights as `/statements/analyze`, for transactions you already have as structured data (up to 5000). Include `balance` when you can: it makes direction detection and the self-check reliable.","operationId":"analyze_transactions_transactions_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisResponse"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"The request body is too large (1 MB for most endpoints; statements may be larger, see /v1/meta).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The file was read but no transactions could be extracted (for example a scanned PDF, a password-protected PDF, or a file that isn't a statement). `details[].reason` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/transactions/bulk":{"post":{"tags":["Subscription Intelligence"],"summary":"Submit customer transactions","description":"Submit up to 5000 transactions for one customer: a full history or just the new ones. Each transaction is validated on its own (a bad one is rejected with a reason; the rest are processed), de-duplicated (re-sending an id is idempotent; the same payment under two ids is flagged), enriched (your `merchant` block, or Merchant Intelligence), stored, and the customer's subscriptions are re-analysed so existing records update in place.","operationId":"ingest_transactions_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkIngestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkIngestResponse"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/subscriptions/analyze":{"post":{"tags":["Subscription Intelligence"],"summary":"Detect a customer's subscriptions","description":"Analyse the customer's submitted history: recurring payments are detected, given a billing frequency and confidence, classified (subscription vs bill vs obligation vs repeated purchase), consolidated into records with stable ids, and totalled per currency. Confidence comes from the detection engine and the history available; it is not fixed.","operationId":"analyze_subscriptions_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeResponse"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`customer_not_found` or `subscription_not_found` (also for ids that belong to another institution).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/customers/{customer_id}/subscriptions":{"get":{"tags":["Subscription Intelligence"],"summary":"List a customer's subscriptions","description":"Records from the latest analysis. Subscriptions only by default; `classification=all` adds bills, obligations and repeated purchases.","operationId":"list_subscriptions_customers__customer_id__subscriptions_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Your identifier for the customer.","title":"Customer Id"},"description":"Your identifier for the customer."},{"name":"classification","in":"query","required":false,"schema":{"anyOf":[{"enum":["subscription","recurring_bill","recurring_obligation","recurring_payment","all"],"type":"string"},{"type":"null"}],"description":"Default `subscription`.","title":"Classification"},"description":"Default `subscription`."},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"One of: Entertainment, Software and SaaS, Music and Streaming, Gaming, Cloud Services, Telecommunications, Utilities, Insurance, Financial Services, Shopping and Retail, Food and Delivery, Transportation, Other.","title":"Category"},"description":"One of: Entertainment, Software and SaaS, Music and Streaming, Gaming, Cloud Services, Telecommunications, Utilities, Insurance, Financial Services, Shopping and Retail, Food and Delivery, Transportation, Other."},{"name":"frequency","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"description":"One of: weekly, fortnightly, monthly, bimonthly, quarterly, semi_annual, annual, irregular.","title":"Frequency"},"description":"One of: weekly, fortnightly, monthly, bimonthly, quarterly, semi_annual, annual, irregular."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active_pattern","observed_recurring","uncertain","inactive"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionList"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`customer_not_found` or `subscription_not_found` (also for ids that belong to another institution).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/subscriptions/{subscription_id}":{"get":{"tags":["Subscription Intelligence"],"summary":"Get one subscription","description":"Merchant details, full payment history, billing frequency, amounts, price changes, irregularities, forecast, confidence and status.","operationId":"get_subscription_subscriptions__subscription_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDetail"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`customer_not_found` or `subscription_not_found` (also for ids that belong to another institution).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customers/{customer_id}/subscription-analytics":{"get":{"tags":["Subscription Intelligence"],"summary":"Customer subscription analytics","description":"Totals per currency, category and frequency breakdowns, upcoming payments and price changes, from the latest analysis.","operationId":"analytics_customers__customer_id__subscription_analytics_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Your identifier for the customer.","title":"Customer Id"},"description":"Your identifier for the customer."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsResponse"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`customer_not_found` or `subscription_not_found` (also for ids that belong to another institution).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customers/{customer_id}":{"delete":{"tags":["Subscription Intelligence"],"summary":"Delete a customer's data","description":"Permanently erases every transaction, subscription record and payment link stored for this customer (for example when they close their account or withdraw consent). Irreversible. Other customers are untouched.","operationId":"delete_customer_customers__customer_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Your identifier for the customer.","title":"Customer Id"},"description":"Your identifier for the customer."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDeleted"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`customer_not_found` or `subscription_not_found` (also for ids that belong to another institution).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customers/{customer_id}/transactions":{"get":{"tags":["Subscription Intelligence"],"summary":"List a customer's stored transactions","description":"Every submitted transaction with its merchant enrichment and payment class (subscription payment, recurring bill, recurring obligation, ordinary purchase, unclassified, ...), newest first.","operationId":"transactions_customers__customer_id__transactions_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Your identifier for the customer.","title":"Customer Id"},"description":"Your identifier for the customer."},{"name":"payment_class","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"One of: subscription_payment, recurring_bill, recurring_obligation, ordinary_purchase, unclassified, credit, failed, transfer, possible_duplicate.","title":"Payment Class"},"description":"One of: subscription_payment, recurring_bill, recurring_obligation, ordinary_purchase, unclassified, credit, failed, transfer, possible_duplicate."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionList"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"`customer_not_found` or `subscription_not_found` (also for ids that belong to another institution).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/events/types":{"get":{"tags":["Webhooks"],"summary":"List event types","description":"Every event type you can subscribe to, with a sample of its `data`. No key needed.","operationId":"event_types_events_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventTypeList"}}}}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List your webhook endpoints","operationId":"list_endpoints_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"Receive events at your URL instead of polling. Each delivery is a `POST` of the event as JSON with a `Tanzim-Signature: t=<unix time>,v1=<hex>` header: the hex is HMAC-SHA256 of `\"<t>.<raw body>\"` with your signing secret (returned once, here). Verify it and reject timestamps older than 5 minutes. Answer any 2xx within 5 seconds; otherwise Tanzim retries after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h. `Tanzim-Event-Id` is stable across retries: use it to ignore duplicates. Redirects are not followed.","operationId":"create_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/webhooks/{endpoint_id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook endpoint","operationId":"get_endpoint_webhooks__endpoint_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"The webhook endpoint id.","title":"Endpoint Id"},"description":"The webhook endpoint id."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint","description":"Stops deliveries and abandons any that are still waiting to be retried.","operationId":"delete_endpoint_webhooks__endpoint_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"The webhook endpoint id.","title":"Endpoint Id"},"description":"The webhook endpoint id."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks/{endpoint_id}/rotate-secret":{"post":{"tags":["Webhooks"],"summary":"Rotate the signing secret","description":"Returns a new secret (shown once). The old secret stops working immediately, so deploy the new one first or accept both for a moment.","operationId":"rotate_webhooks__endpoint_id__rotate_secret_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"The webhook endpoint id.","title":"Endpoint Id"},"description":"The webhook endpoint id."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks/{endpoint_id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test event","description":"Simulate an event: sends a sample event (`test: true`) of the type you choose to this endpoint right now, with one attempt and no retries, and returns what happened (`status`, `last_status_code`, `last_error`). Use it to build and debug your handler.","operationId":"test_event_webhooks__endpoint_id__test_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"The webhook endpoint id.","title":"Endpoint Id"},"description":"The webhook endpoint id."}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/WebhookTestRequest"},{"type":"null"}],"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks/{endpoint_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Delivery log","description":"The most recent deliveries to this endpoint, newest first: what was sent, how many attempts, and why a delivery failed.","operationId":"deliveries_webhooks__endpoint_id__deliveries_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"The webhook endpoint id.","title":"Endpoint Id"},"description":"The webhook endpoint id."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/events":{"get":{"tags":["Webhooks"],"summary":"List events","description":"The event log, newest first: the same events webhooks carry, for clients that cannot receive webhooks or want to catch up.","operationId":"list_events_events_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"400":{"description":"The request body or a parameter is missing or malformed. `details` lists the offending fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"`missing_api_key` or `invalid_api_key`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"AmountRange":{"properties":{"min":{"type":"number","title":"Min"},"max":{"type":"number","title":"Max"}},"type":"object","required":["min","max"],"title":"AmountRange"},"AnalysisPeriod":{"properties":{"months":{"type":"integer","title":"Months"},"from":{"type":"string","title":"From"},"to":{"type":"string","title":"To"}},"type":"object","required":["months","from","to"],"title":"AnalysisPeriod"},"AnalysisResponse":{"properties":{"request_id":{"type":"string","title":"Request Id"},"engine_version":{"type":"string","title":"Engine Version"},"statement":{"$ref":"#/components/schemas/StatementInfo"},"transactions":{"items":{"$ref":"#/components/schemas/StatementTransaction"},"type":"array","title":"Transactions"},"insights":{"$ref":"#/components/schemas/Insights"}},"type":"object","required":["request_id","engine_version","statement","transactions","insights"],"title":"AnalysisResponse"},"AnalyticsResponse":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"as_of":{"type":"string","title":"As Of"},"analysed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysed At"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"mixed_currencies":{"type":"boolean","title":"Mixed Currencies"},"total_subscriptions":{"type":"integer","title":"Total Subscriptions"},"active_subscriptions":{"type":"integer","title":"Active Subscriptions","description":"Subscriptions counted in the totals."},"monthly_expenditure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Expenditure"},"annualised_expenditure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annualised Expenditure"},"average_subscription_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Subscription Amount","description":"Average monthly-equivalent amount of the counted subscriptions."},"category_breakdown":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Category Breakdown"},"frequency_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Frequency Breakdown"},"monthly_subscriptions":{"type":"integer","title":"Monthly Subscriptions"},"annual_subscriptions":{"type":"integer","title":"Annual Subscriptions"},"upcoming_payments":{"type":"integer","title":"Upcoming Payments","description":"Expected payments in the next 30 days (subscriptions, bills and obligations)."},"upcoming_payments_7_days":{"type":"integer","title":"Upcoming Payments 7 Days"},"upcoming":{"items":{"$ref":"#/components/schemas/UpcomingPayment"},"type":"array","title":"Upcoming"},"price_changes":{"items":{"$ref":"#/components/schemas/CustomerPriceChange"},"type":"array","title":"Price Changes"},"totals_by_currency":{"items":{"$ref":"#/components/schemas/CurrencyTotals"},"type":"array","title":"Totals By Currency"},"other_recurring":{"$ref":"#/components/schemas/OtherRecurringSummary"}},"type":"object","required":["customer_id","as_of","mixed_currencies","total_subscriptions","active_subscriptions","frequency_breakdown","monthly_subscriptions","annual_subscriptions","upcoming_payments","upcoming_payments_7_days","upcoming","price_changes","totals_by_currency","other_recurring"],"title":"AnalyticsResponse"},"AnalyzeRequest":{"properties":{"customer_id":{"type":"string","maxLength":128,"minLength":1,"title":"Customer Id","examples":["CUST001"]},"analysis_period_months":{"type":"integer","maximum":60.0,"minimum":1.0,"title":"Analysis Period Months","description":"How far back from `as_of` to look. Annual subscriptions need more than 12 months to be seen twice.","default":12},"include_forecasts":{"type":"boolean","title":"Include Forecasts","description":"Include `upcoming_payments` (next 7 and 30 days).","default":true},"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of","description":"Date to analyse as of (status and forecasts are relative to it). Defaults to today (UTC). Remembered: later uploads for this customer re-analyse with the same settings."}},"type":"object","required":["customer_id"],"title":"AnalyzeRequest"},"AnalyzeResponse":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"analysis_status":{"type":"string","title":"Analysis Status"},"as_of":{"type":"string","title":"As Of"},"analysis_period":{"$ref":"#/components/schemas/AnalysisPeriod"},"transactions_analysed":{"type":"integer","title":"Transactions Analysed"},"total_subscriptions":{"type":"integer","title":"Total Subscriptions"},"monthly_expenditure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Expenditure","description":"Null when subscriptions are in more than one currency: see `totals_by_currency`. Currencies are never added together."},"annualised_expenditure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annualised Expenditure"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"mixed_currencies":{"type":"boolean","title":"Mixed Currencies"},"category_breakdown":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Category Breakdown"},"totals_by_currency":{"items":{"$ref":"#/components/schemas/CurrencyTotals"},"type":"array","title":"Totals By Currency"},"subscriptions":{"items":{"$ref":"#/components/schemas/Subscription"},"type":"array","title":"Subscriptions"},"other_recurring":{"items":{"$ref":"#/components/schemas/Subscription"},"type":"array","title":"Other Recurring","description":"Recurring bills, obligations and repeated purchases: recurring, but not subscriptions."},"transaction_classes":{"additionalProperties":{"type":"integer"},"type":"object","title":"Transaction Classes","description":"Transactions in the window per payment class: subscription_payment, recurring_bill, recurring_obligation, ordinary_purchase, unclassified, credit, failed, transfer, possible_duplicate."},"upcoming_payments":{"anyOf":[{"$ref":"#/components/schemas/Upcoming"},{"type":"null"}]},"engine_version":{"type":"string","title":"Engine Version"},"input_contract_version":{"type":"string","title":"Input Contract Version"}},"type":"object","required":["customer_id","analysis_status","as_of","analysis_period","transactions_analysed","total_subscriptions","mixed_currencies","totals_by_currency","subscriptions","other_recurring","transaction_classes","engine_version","input_contract_version"],"title":"AnalyzeResponse"},"BatchRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EnrichRequest"},"type":"array","maxItems":100,"minItems":1,"title":"Items","description":"1 to 100 transactions. Results come back in the same order."}},"type":"object","required":["items"],"title":"BatchRequest"},"BatchResponse":{"properties":{"request_id":{"type":"string","title":"Request Id"},"engine_version":{"type":"string","title":"Engine Version"},"results":{"items":{"$ref":"#/components/schemas/EnrichResult"},"type":"array","title":"Results"}},"type":"object","required":["request_id","engine_version","results"],"title":"BatchResponse"},"Body_analyze_statement_file_statements_analyze_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"The statement file: PDF (with selectable text), CSV or Excel (.xlsx)."}},"type":"object","required":["file"],"title":"Body_analyze_statement_file_statements_analyze_post"},"BulkIngestRequest":{"properties":{"customer_id":{"type":"string","maxLength":128,"minLength":1,"title":"Customer Id","examples":["CUST001"]},"transactions":{"items":{"$ref":"#/components/schemas/IngestTransaction"},"type":"array","maxItems":5000,"minItems":1,"title":"Transactions","description":"1 to 5000 transactions. Historical and incremental uploads both work."}},"type":"object","required":["customer_id","transactions"],"title":"BulkIngestRequest"},"BulkIngestResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"customer_id":{"type":"string","title":"Customer Id"},"transactions_received":{"type":"integer","title":"Transactions Received"},"transactions_processed":{"type":"integer","title":"Transactions Processed","description":"New transactions stored."},"transactions_rejected":{"type":"integer","title":"Transactions Rejected"},"transactions_duplicate":{"type":"integer","title":"Transactions Duplicate","description":"Already received earlier (idempotent replays)."},"possible_duplicates":{"type":"integer","title":"Possible Duplicates"},"status":{"type":"string","title":"Status","description":"`completed`: the transactions are stored and the customer's subscriptions re-analysed."},"enrichment":{"$ref":"#/components/schemas/EnrichmentCounts"},"rejections":{"items":{"$ref":"#/components/schemas/Rejected"},"type":"array","title":"Rejections","description":"Why each rejected transaction was refused (first 200)."},"duplicates":{"items":{"$ref":"#/components/schemas/Duplicate"},"type":"array","title":"Duplicates","description":"First 200."},"subscriptions_updated":{"type":"boolean","title":"Subscriptions Updated","description":"True when the new transactions re-ran the customer's analysis."},"total_subscriptions":{"type":"integer","title":"Total Subscriptions"}},"type":"object","required":["success","customer_id","transactions_received","transactions_processed","transactions_rejected","transactions_duplicate","possible_duplicates","status","enrichment","rejections","duplicates","subscriptions_updated","total_subscriptions"],"title":"BulkIngestResponse"},"CategoryCount":{"properties":{"name":{"type":"string","title":"Name"},"merchants":{"type":"integer","title":"Merchants"}},"type":"object","required":["name","merchants"],"title":"CategoryCount"},"CategoryInsight":{"properties":{"category":{"type":"string","title":"Category","description":"Merchant category; unidentified spending is grouped as `Unidentified`."},"amount":{"type":"number","title":"Amount"},"count":{"type":"integer","title":"Count"},"share":{"type":"number","title":"Share","description":"Share of total spending, 0 to 1."},"top_merchants":{"items":{"type":"string"},"type":"array","title":"Top Merchants"}},"type":"object","required":["category","amount","count","share","top_merchants"],"title":"CategoryInsight"},"ClientMerchant":{"properties":{"merchant_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Merchant Id","description":"Your/Merchant Intelligence's stable merchant id.","examples":["MER001"]},"merchant_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Merchant Name","description":"Canonical merchant name.","examples":["Netflix"]},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category","description":"Merchant Intelligence category (e.g. `Subscriptions & OTT`, `Utilities - Electricity`).","examples":["Subscriptions & OTT"]},"subcategory":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Subcategory","examples":["OTT - International"]},"confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence","description":"Merchant resolution confidence, 0 to 1. Defaults to 1."},"logo_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Logo Url"},"domain":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Domain"},"is_person":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Person","description":"True when the counterparty is a person (a transfer), not a merchant."}},"type":"object","title":"ClientMerchant","description":"Merchant Intelligence output you already have (the Enriched Transaction Data Contract). Send it and Tanzim\nuses it as is; leave it out and Tanzim resolves the merchant from the description."},"CounterpartyInfo":{"properties":{"name":{"type":"string","title":"Name","description":"The other person's name with sensible capitalisation (\"RAO EHTISHAM ALI KHAN\" -> \"Rao Ehtisham Ali Khan\").","examples":["Ali Raza"]},"raw_name":{"type":"string","title":"Raw Name","description":"Exactly as printed on the statement (the account title returned by the bank's title fetch).","examples":["ALI RAZA"]},"bank":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank","description":"The other party's bank or wallet, when the narration shows it.","examples":["HBL"]},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel","description":"`ibft`, `raast`, `wallet`, `transfer`, or `card` (a card payment made to a person's name)."},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction","description":"`in` or `out`, from the wording of the narration. A statement's debit/credit is more reliable when you have it."},"confidence":{"type":"string","title":"Confidence","description":"`high` (two or more words) or `low` (a single word)."}},"type":"object","required":["name","raw_name","confidence"],"title":"CounterpartyInfo"},"CounterpartyInsight":{"properties":{"name":{"type":"string","title":"Name"},"sent":{"type":"number","title":"Sent"},"received":{"type":"number","title":"Received"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["name","sent","received","count"],"title":"CounterpartyInsight"},"CurrencyTotals":{"properties":{"currency":{"type":"string","title":"Currency"},"subscriptions":{"type":"integer","title":"Subscriptions"},"counted_in_totals":{"type":"integer","title":"Counted In Totals"},"monthly_expenditure":{"type":"number","title":"Monthly Expenditure"},"annualised_expenditure":{"type":"number","title":"Annualised Expenditure"},"average_monthly_subscription":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Monthly Subscription"},"category_breakdown":{"additionalProperties":{"type":"number"},"type":"object","title":"Category Breakdown"}},"type":"object","required":["currency","subscriptions","counted_in_totals","monthly_expenditure","annualised_expenditure","category_breakdown"],"title":"CurrencyTotals"},"CustomerDeleted":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"deleted":{"type":"boolean","title":"Deleted"},"removed":{"$ref":"#/components/schemas/Removed"}},"type":"object","required":["customer_id","deleted","removed"],"title":"CustomerDeleted"},"CustomerPriceChange":{"properties":{"date":{"type":"string","title":"Date"},"transaction_id":{"type":"string","title":"Transaction Id"},"direction":{"type":"string","title":"Direction","description":"`increase` or `decrease`."},"previous_average":{"type":"number","title":"Previous Average"},"new_amount":{"type":"number","title":"New Amount"},"change_amount":{"type":"number","title":"Change Amount"},"change_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change Percent"},"confirmed":{"type":"boolean","title":"Confirmed","description":"True once the new amount has been charged at least twice."},"note":{"type":"string","title":"Note"},"subscription_id":{"type":"string","title":"Subscription Id"},"merchant_name":{"type":"string","title":"Merchant Name"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["date","transaction_id","direction","previous_average","new_amount","change_amount","confirmed","note","subscription_id","merchant_name","currency"],"title":"CustomerPriceChange"},"Duplicate":{"properties":{"index":{"type":"integer","title":"Index"},"transaction_id":{"type":"string","title":"Transaction Id"},"kind":{"type":"string","title":"Kind","description":"`already_received` (same id and content as before: ignored) or `possible_duplicate` (same customer, date, amount, currency and description under a different id: stored, flagged, never counted twice)."},"duplicate_of":{"type":"string","title":"Duplicate Of"}},"type":"object","required":["index","transaction_id","kind","duplicate_of"],"title":"Duplicate"},"EnrichRequest":{"properties":{"description":{"type":"string","maxLength":1000,"minLength":1,"title":"Description","description":"The raw transaction string exactly as it appears on the statement or card feed.","examples":["NETFLIX.COM 4029357689"]},"mcc":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}],"title":"Mcc","description":"Optional 4-digit Merchant Category Code from the card network. Used only as a fallback category when the merchant cannot be identified. `mcc_code` is accepted as an alias.","examples":["5968"]}},"type":"object","required":["description"],"title":"EnrichRequest"},"EnrichResponse":{"properties":{"input":{"type":"string","title":"Input","description":"The description you sent, echoed back (handy for batches)."},"matched":{"type":"boolean","title":"Matched","description":"True when a specific merchant was identified. Check this before using `merchant_name`."},"merchant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Name","description":"Canonical merchant name. null when `matched` is false.","examples":["Netflix"]},"merchant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Id","description":"Stable id for the merchant: the same merchant always has the same id, across requests and clients. Use it to group transactions by merchant. null when `matched` is false.","examples":["mer_e42776aa5123"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Spending category. When `matched` is false this is only set if you sent an `mcc`.","examples":["Subscriptions & OTT"]},"subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subcategory","examples":["OTT - International"]},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"ISO 3166-1 alpha-2 country the merchant operates in, where known; otherwise null.","examples":["PK"]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"Logo/icon image URL. Checked to load when last verified; null when no working logo is known, so show your own placeholder (e.g. the merchant's initial)."},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website","examples":["https://netflix.com"]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","examples":["netflix.com"]},"mcc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mcc","description":"The merchant's usual Merchant Category Code, where known.","examples":["5968"]},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"How sure Tanzim is that `merchant_name` is right, 0 to 1. It is derived from the match method and similarity score, not a calibrated probability: treat >= 0.9 as reliable and anything lower as worth a human glance. Always 0 when `matched` is false.","examples":[0.99]},"match":{"$ref":"#/components/schemas/Match"},"counterparty":{"anyOf":[{"$ref":"#/components/schemas/CounterpartyInfo"},{"type":"null"}],"description":"For person-to-person transfers whose narration names the other person (IBFT / Raast / wallet title fetch): who it is. When present, `matched` is false unless a real merchant was identified."},"request_id":{"type":"string","title":"Request Id","description":"Unique id for this request; also sent as the `X-Request-Id` header."},"engine_version":{"type":"string","title":"Engine Version","description":"Version of the matching engine + merchant data that produced this result.","examples":["3.1.0+18b095da"]}},"type":"object","required":["input","matched","confidence","match","request_id","engine_version"],"title":"EnrichResponse"},"EnrichResult":{"properties":{"input":{"type":"string","title":"Input","description":"The description you sent, echoed back (handy for batches)."},"matched":{"type":"boolean","title":"Matched","description":"True when a specific merchant was identified. Check this before using `merchant_name`."},"merchant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Name","description":"Canonical merchant name. null when `matched` is false.","examples":["Netflix"]},"merchant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Id","description":"Stable id for the merchant: the same merchant always has the same id, across requests and clients. Use it to group transactions by merchant. null when `matched` is false.","examples":["mer_e42776aa5123"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Spending category. When `matched` is false this is only set if you sent an `mcc`.","examples":["Subscriptions & OTT"]},"subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subcategory","examples":["OTT - International"]},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"ISO 3166-1 alpha-2 country the merchant operates in, where known; otherwise null.","examples":["PK"]},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"Logo/icon image URL. Checked to load when last verified; null when no working logo is known, so show your own placeholder (e.g. the merchant's initial)."},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website","examples":["https://netflix.com"]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","examples":["netflix.com"]},"mcc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mcc","description":"The merchant's usual Merchant Category Code, where known.","examples":["5968"]},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"How sure Tanzim is that `merchant_name` is right, 0 to 1. It is derived from the match method and similarity score, not a calibrated probability: treat >= 0.9 as reliable and anything lower as worth a human glance. Always 0 when `matched` is false.","examples":[0.99]},"match":{"$ref":"#/components/schemas/Match"},"counterparty":{"anyOf":[{"$ref":"#/components/schemas/CounterpartyInfo"},{"type":"null"}],"description":"For person-to-person transfers whose narration names the other person (IBFT / Raast / wallet title fetch): who it is. When present, `matched` is false unless a real merchant was identified."}},"type":"object","required":["input","matched","confidence","match"],"title":"EnrichResult"},"EnrichmentCounts":{"properties":{"merchant_supplied":{"type":"integer","title":"Merchant Supplied","description":"Transactions that arrived with a `merchant` block."},"resolved_by_tanzim":{"type":"integer","title":"Resolved By Tanzim","description":"Resolved by Merchant Intelligence from the description."},"unresolved":{"type":"integer","title":"Unresolved","description":"Merchant not identified; grouped by a cleaned description instead."}},"type":"object","required":["merchant_supplied","resolved_by_tanzim","unresolved"],"title":"EnrichmentCounts"},"ErrorBody":{"properties":{"code":{"type":"string","title":"Code","examples":["invalid_api_key"]},"message":{"type":"string","title":"Message"},"request_id":{"type":"string","title":"Request Id"},"details":{"anyOf":[{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array"},{"type":"null"}],"title":"Details","description":"Per-field problems for `invalid_request`."}},"type":"object","required":["code","message","request_id"],"title":"ErrorBody"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorResponse"},"Event":{"properties":{"id":{"type":"string","title":"Id","examples":["evt_0a1b2c3d4e5f6a7b8c9d"]},"object":{"type":"string","title":"Object","default":"event"},"type":{"type":"string","title":"Type","examples":["subscription.renewal_due"]},"created_at":{"type":"string","title":"Created At"},"livemode":{"type":"boolean","title":"Livemode"},"test":{"type":"boolean","title":"Test","description":"True for events sent by `POST /v1/webhooks/{id}/test`."},"data":{"type":"object","title":"Data"}},"type":"object","required":["id","type","created_at","livemode","test","data"],"title":"Event"},"EventList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Event"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"EventList"},"EventType":{"properties":{"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"},"example":{"type":"object","title":"Example","description":"What `data` looks like."}},"type":"object","required":["type","description","example"],"title":"EventType"},"EventTypeList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/EventType"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"EventTypeList"},"ExampleItem":{"properties":{"description":{"type":"string","title":"Description"},"mcc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mcc"},"note":{"type":"string","title":"Note"},"result":{"$ref":"#/components/schemas/EnrichResult"}},"type":"object","required":["description","note","result"],"title":"ExampleItem"},"ExamplesResponse":{"properties":{"engine_version":{"type":"string","title":"Engine Version"},"examples":{"items":{"$ref":"#/components/schemas/ExampleItem"},"type":"array","title":"Examples"}},"type":"object","required":["engine_version","examples"],"title":"ExamplesResponse"},"Forecast":{"properties":{"next_expected_payment":{"type":"string","title":"Next Expected Payment"},"estimated_amount":{"type":"number","title":"Estimated Amount"},"currency":{"type":"string","title":"Currency"},"confidence":{"type":"number","title":"Confidence"},"is_estimate":{"type":"boolean","title":"Is Estimate"},"note":{"type":"string","title":"Note"}},"type":"object","required":["next_expected_payment","estimated_amount","currency","confidence","is_estimate","note"],"title":"Forecast"},"Health":{"properties":{"status":{"type":"string","title":"Status"},"environment":{"type":"string","title":"Environment","description":"`sandbox` (accepts only `tz_test_` keys), `production` (only `tz_live_` keys) or `shared` (both).","examples":["sandbox"]}},"type":"object","required":["status","environment"],"title":"Health"},"Identification":{"properties":{"spending_transactions":{"type":"integer","title":"Spending Transactions"},"identified_transactions":{"type":"integer","title":"Identified Transactions"},"identified_share_of_transactions":{"type":"number","title":"Identified Share Of Transactions"},"identified_share_of_spending":{"type":"number","title":"Identified Share Of Spending","description":"How much of the spending was matched to a known merchant, 0 to 1."},"unidentified_top":{"items":{"$ref":"#/components/schemas/UnidentifiedItem"},"type":"array","title":"Unidentified Top","description":"The biggest spending items Tanzim could not identify."}},"type":"object","required":["spending_transactions","identified_transactions","identified_share_of_transactions","identified_share_of_spending","unidentified_top"],"title":"Identification"},"IngestTransaction":{"properties":{"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id","description":"**Required.** Your unique id for the transaction. Re-sending an id is idempotent.","examples":["TXN001"]},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id","description":"Optional; must equal the request's `customer_id` if sent."},"transaction_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Date","description":"**Required.** ISO 8601 date or datetime.","examples":["2026-01-01"]},"transaction_amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Transaction Amount","description":"**Required.** Amount in `currency`. Sign is ignored; `transaction_type` gives the direction.","examples":[1100]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"**Required.** ISO 4217 code.","examples":["PKR"]},"transaction_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Description","description":"**Required.** The narration exactly as on the statement / card feed.","examples":["NETFLIX.COM"]},"transaction_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Type","description":"**Required.** `DEBIT` or `CREDIT` (also accepted: PURCHASE, PAYMENT, CARD, POS, DIRECT_DEBIT, REFUND, REVERSAL, ...).","examples":["DEBIT"]},"merchant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Name","description":"Merchant name from your card feed, if any. Tried when the description cannot be resolved."},"merchant_category_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Category Code","description":"4-digit MCC.","examples":["4899"]},"card_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Identifier","description":"A card token or last 4 digits. Full card numbers are rejected.","examples":["tok_8842"]},"transaction_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Reference"},"payment_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Channel","examples":["ECOM"]},"debit_credit_indicator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Debit Credit Indicator","description":"`D`/`C` (or DR/CR, DEBIT/CREDIT); overrides `transaction_type` for the direction."},"original_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Currency","description":"Currency the merchant charged in, for cross-currency card payments.","examples":["USD"]},"original_amount":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Original Amount","description":"Amount in `original_currency`. Lets Tanzim tell an FX movement from a price change."},"transaction_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Status","description":"POSTED (default), PENDING, or FAILED / DECLINED / REVERSED. Failed payments are kept as irregularities, never as payments."},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"merchant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Id","description":"The card network's merchant id, if any (stored; not used for grouping)."},"payment_instrument_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Instrument Type","examples":["CARD"]},"merchant":{"anyOf":[{"$ref":"#/components/schemas/ClientMerchant"},{"type":"null"}],"description":"Pre-enriched merchant data from Merchant Intelligence (optional)."}},"type":"object","title":"IngestTransaction"},"Insights":{"properties":{"summary":{"$ref":"#/components/schemas/Summary"},"by_kind":{"items":{"$ref":"#/components/schemas/KindTotal"},"type":"array","title":"By Kind"},"categories":{"items":{"$ref":"#/components/schemas/CategoryInsight"},"type":"array","title":"Categories"},"top_merchants":{"items":{"$ref":"#/components/schemas/MerchantInsight"},"type":"array","title":"Top Merchants"},"monthly":{"items":{"$ref":"#/components/schemas/MonthInsight"},"type":"array","title":"Monthly"},"recurring":{"items":{"$ref":"#/components/schemas/RecurringInsight"},"type":"array","title":"Recurring","description":"Repeating payments (subscriptions, bills) detected from the dates and amounts."},"monthly_recurring_total":{"type":"number","title":"Monthly Recurring Total"},"largest_transactions":{"items":{"$ref":"#/components/schemas/LargeTransaction"},"type":"array","title":"Largest Transactions"},"counterparties":{"items":{"$ref":"#/components/schemas/CounterpartyInsight"},"type":"array","title":"Counterparties"},"payees":{"items":{"$ref":"#/components/schemas/PayeeInsight"},"type":"array","title":"Payees","description":"People you transact with, grouped across spellings, biggest first."},"regular_unnamed_transfers":{"items":{"$ref":"#/components/schemas/RegularTransfer"},"type":"array","title":"Regular Unnamed Transfers","description":"Repeating transfers with the same amount whose statement line names nobody: likely the same person or account. A pattern, not an identified payee."},"transfer_summary":{"$ref":"#/components/schemas/TransferSummary"},"identification":{"$ref":"#/components/schemas/Identification"}},"type":"object","required":["summary","by_kind","categories","top_merchants","monthly","recurring","monthly_recurring_total","largest_transactions","counterparties","payees","regular_unnamed_transfers","transfer_summary","identification"],"title":"Insights"},"Irregularity":{"properties":{"type":{"type":"string","title":"Type","description":"`missed_payment`, `failed_payment` or `one_off_amount` (a single different amount followed by a return to the usual one: discount, tax, partial charge)."},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"expected_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Date"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"usual_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Usual Amount"},"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id"}},"type":"object","required":["type"],"title":"Irregularity"},"KeyCreated":{"properties":{"key":{"type":"string","title":"Key","description":"The API key. Shown ONCE — store it now.","examples":["tz_test_..."]},"id":{"type":"string","title":"Id"},"prefix":{"type":"string","title":"Prefix","description":"First characters of the key, to recognise it later."},"environment":{"type":"string","title":"Environment","description":"`test` for now. Test keys are rate limited and their inputs are logged to improve Tanzim."},"created_at":{"type":"string","title":"Created At"},"rate_limits":{"$ref":"#/components/schemas/RateLimits"},"message":{"type":"string","title":"Message"}},"type":"object","required":["key","id","prefix","environment","created_at","rate_limits","message"],"title":"KeyCreated"},"KeyRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name","description":"What you're building (shown only to you).","examples":["My budgeting app"]},"email":{"anyOf":[{"type":"string","maxLength":254,"pattern":"^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$"},{"type":"null"}],"title":"Email","description":"Optional, but lets us tell you about breaking changes and quota."},"source":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Source","description":"Free-form label for where the key was requested from."}},"type":"object","title":"KeyRequest"},"KindTotal":{"properties":{"kind":{"type":"string","title":"Kind"},"count":{"type":"integer","title":"Count"},"debit_amount":{"type":"number","title":"Debit Amount"},"credit_amount":{"type":"number","title":"Credit Amount"}},"type":"object","required":["kind","count","debit_amount","credit_amount"],"title":"KindTotal"},"LargeTransaction":{"properties":{"date":{"type":"string","title":"Date"},"description":{"type":"string","title":"Description"},"amount":{"type":"number","title":"Amount"},"merchant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant"},"kind":{"type":"string","title":"Kind"}},"type":"object","required":["date","description","amount","kind"],"title":"LargeTransaction"},"Match":{"properties":{"method":{"type":"string","title":"Method","description":"How the merchant was identified: `exact` (the whole string is a known name), `substring` (a known name appears inside it), `fuzzy` (a close misspelling/partial match), `mcc_fallback` (merchant unknown, category taken from the MCC you sent) or `none`.","examples":["substring"]},"matched_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched On","description":"The known name/alias that matched, normalised. Useful for debugging.","examples":["NETFLIX COM"]}},"type":"object","required":["method"],"title":"Match"},"Me":{"properties":{"key_id":{"type":"string","title":"Key Id"},"prefix":{"type":"string","title":"Prefix"},"environment":{"type":"string","title":"Environment"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"created_at":{"type":"string","title":"Created At"},"rate_limits":{"$ref":"#/components/schemas/RateLimits"},"usage":{"$ref":"#/components/schemas/Usage"}},"type":"object","required":["key_id","prefix","environment","created_at","rate_limits","usage"],"title":"Me"},"MerchantDetails":{"properties":{"merchant_id":{"type":"string","title":"Merchant Id"},"merchant_name":{"type":"string","title":"Merchant Name"},"resolved":{"type":"boolean","title":"Resolved"},"resolution_confidence":{"type":"number","title":"Resolution Confidence"},"category":{"type":"string","title":"Category"},"source_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Category"},"source_subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Subcategory"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},"type":"object","required":["merchant_id","merchant_name","resolved","resolution_confidence","category"],"title":"MerchantDetails"},"MerchantInsight":{"properties":{"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"count":{"type":"integer","title":"Count"},"amount":{"type":"number","title":"Amount"},"average":{"type":"number","title":"Average"},"share":{"type":"number","title":"Share"},"first_date":{"type":"string","title":"First Date"},"last_date":{"type":"string","title":"Last Date"}},"type":"object","required":["name","count","amount","average","share","first_date","last_date"],"title":"MerchantInsight"},"Meta":{"properties":{"api_version":{"type":"string","title":"Api Version"},"contract_version":{"type":"string","title":"Contract Version"},"engine_version":{"type":"string","title":"Engine Version"},"environment":{"type":"string","title":"Environment"},"merchant_count":{"type":"integer","title":"Merchant Count","description":"Merchants with a full profile."},"alias_count":{"type":"integer","title":"Alias Count","description":"Distinct name variants the engine recognises."},"categories":{"items":{"$ref":"#/components/schemas/CategoryCount"},"type":"array","title":"Categories"},"rate_limits":{"$ref":"#/components/schemas/RateLimits"},"max_batch_size":{"type":"integer","title":"Max Batch Size"},"subscription_engine_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Engine Version","description":"Version of the Subscription Intelligence detection engine."}},"type":"object","required":["api_version","contract_version","engine_version","environment","merchant_count","alias_count","categories","rate_limits","max_batch_size"],"title":"Meta"},"MonthInsight":{"properties":{"month":{"type":"string","title":"Month","description":"YYYY-MM"},"count":{"type":"integer","title":"Count"},"spending":{"type":"number","title":"Spending"},"transfers_out":{"type":"number","title":"Transfers Out"},"credits":{"type":"number","title":"Credits"},"net":{"type":"number","title":"Net"}},"type":"object","required":["month","count","spending","transfers_out","credits","net"],"title":"MonthInsight"},"OtherRecurringSummary":{"properties":{"count":{"type":"integer","title":"Count"},"by_classification":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Classification"},"totals_by_currency":{"items":{"$ref":"#/components/schemas/CurrencyTotals"},"type":"array","title":"Totals By Currency"}},"type":"object","required":["count","by_classification","totals_by_currency"],"title":"OtherRecurringSummary"},"PayeeInsight":{"properties":{"payee_id":{"type":"string","title":"Payee Id"},"name":{"type":"string","title":"Name","description":"The fullest spelling seen, capitalisation normalised."},"aliases":{"items":{"type":"string"},"type":"array","title":"Aliases","description":"Other spellings of the same person seen on the statement."},"banks":{"items":{"type":"string"},"type":"array","title":"Banks"},"channels":{"items":{"type":"string"},"type":"array","title":"Channels"},"sent":{"type":"number","title":"Sent","description":"Total you sent them."},"received":{"type":"number","title":"Received","description":"Total they sent you."},"sent_count":{"type":"integer","title":"Sent Count"},"received_count":{"type":"integer","title":"Received Count"},"first_date":{"type":"string","title":"First Date"},"last_date":{"type":"string","title":"Last Date"},"typical_sent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Typical Sent","description":"Median amount you send them."},"typical_interval_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Typical Interval Days","description":"Median days between transactions with them (needs 3 or more)."},"regular":{"type":"boolean","title":"Regular","description":"Three or more transactions across at least two months."},"relationship":{"type":"string","title":"Relationship","description":"`you pay them`, `they pay you` or `two-way`."}},"type":"object","required":["payee_id","name","aliases","banks","channels","sent","received","sent_count","received_count","first_date","last_date","regular","relationship"],"title":"PayeeInsight"},"PaymentRecord":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id"},"payment_date":{"type":"string","title":"Payment Date"},"amount":{"type":"number","title":"Amount"},"currency":{"type":"string","title":"Currency"},"description":{"type":"string","title":"Description"},"status":{"type":"string","title":"Status"},"original_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Currency"},"original_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Original Amount"}},"type":"object","required":["transaction_id","payment_date","amount","currency","description","status"],"title":"PaymentRecord"},"PriceChange":{"properties":{"date":{"type":"string","title":"Date"},"transaction_id":{"type":"string","title":"Transaction Id"},"direction":{"type":"string","title":"Direction","description":"`increase` or `decrease`."},"previous_average":{"type":"number","title":"Previous Average"},"new_amount":{"type":"number","title":"New Amount"},"change_amount":{"type":"number","title":"Change Amount"},"change_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change Percent"},"confirmed":{"type":"boolean","title":"Confirmed","description":"True once the new amount has been charged at least twice."},"note":{"type":"string","title":"Note"}},"type":"object","required":["date","transaction_id","direction","previous_average","new_amount","change_amount","confirmed","note"],"title":"PriceChange"},"RateLimits":{"properties":{"per_minute":{"type":"integer","title":"Per Minute"},"per_day":{"type":"integer","title":"Per Day"},"statements_per_hour":{"type":"integer","title":"Statements Per Hour","description":"Statement analyses (file uploads or /transactions/analyze calls) per hour.","default":20}},"type":"object","required":["per_minute","per_day"],"title":"RateLimits"},"Reconciliation":{"properties":{"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","description":"`running_balance`: every row was checked against the statement's balance column."},"checked":{"type":"integer","title":"Checked","description":"Rows that could be checked against the running balance.","default":0},"matched":{"type":"integer","title":"Matched","description":"Rows whose amount and direction agree with the running balance.","default":0},"match_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Match Rate","description":"matched / checked. At or above 0.98 the parse is almost certainly right."},"opening_to_closing_difference":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Opening To Closing Difference","description":"opening balance + credits - debits - closing balance. 0 when the statement adds up."},"totals_match":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Totals Match","description":"True when opening + credits - debits equals the closing balance."}},"type":"object","title":"Reconciliation"},"RecurringInsight":{"properties":{"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"frequency":{"type":"string","title":"Frequency","description":"`weekly`, `fortnightly`, `monthly`, `quarterly` or `yearly`."},"occurrences":{"type":"integer","title":"Occurrences"},"typical_amount":{"type":"number","title":"Typical Amount"},"amount_varies":{"type":"boolean","title":"Amount Varies","description":"True for bills whose amount changes month to month (electricity, phone)."},"total":{"type":"number","title":"Total"},"first_date":{"type":"string","title":"First Date"},"last_date":{"type":"string","title":"Last Date"},"next_expected":{"type":"string","title":"Next Expected"},"monthly_cost":{"type":"number","title":"Monthly Cost","description":"Typical amount converted to a per-month figure."},"confidence":{"type":"string","title":"Confidence"},"likely_subscription":{"type":"boolean","title":"Likely Subscription"}},"type":"object","required":["name","frequency","occurrences","typical_amount","amount_varies","total","first_date","last_date","next_expected","monthly_cost","confidence","likely_subscription"],"title":"RecurringInsight"},"RegularTransfer":{"properties":{"direction":{"type":"string","title":"Direction","description":"`debit` (you send) or `credit` (you receive)."},"amount":{"type":"number","title":"Amount"},"count":{"type":"integer","title":"Count"},"total":{"type":"number","title":"Total"},"first_date":{"type":"string","title":"First Date"},"last_date":{"type":"string","title":"Last Date"},"typical_interval_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Typical Interval Days"},"share_of_transfers":{"type":"number","title":"Share Of Transfers","description":"Share of that direction's transfers that have this exact amount."}},"type":"object","required":["direction","amount","count","total","first_date","last_date","share_of_transfers"],"title":"RegularTransfer"},"Rejected":{"properties":{"index":{"type":"integer","title":"Index","description":"Position in the request's `transactions` array."},"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id"},"field":{"type":"string","title":"Field"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["index","field","reason"],"title":"Rejected"},"Removed":{"properties":{"transactions":{"type":"integer","title":"Transactions"},"subscriptions":{"type":"integer","title":"Subscriptions"},"subscription_payments":{"type":"integer","title":"Subscription Payments"}},"type":"object","required":["transactions","subscriptions","subscription_payments"],"title":"Removed"},"Revoked":{"properties":{"revoked":{"type":"boolean","title":"Revoked"}},"type":"object","required":["revoked"],"title":"Revoked"},"StatementInfo":{"properties":{"format":{"type":"string","title":"Format","description":"`csv`, `xlsx`, `pdf` or `json`."},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"currency":{"type":"string","title":"Currency"},"transactions":{"type":"integer","title":"Transactions","description":"Transactions extracted."},"rows_read":{"type":"integer","title":"Rows Read"},"rows_skipped":{"type":"integer","title":"Rows Skipped","description":"Rows that were not transactions (totals, headers, notes) or could not be read."},"confidence":{"type":"string","title":"Confidence","description":"How much to trust the parse: `high`, `medium` or `low`. `high` means the statement's own balances check out."},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Human-readable problems found while parsing. Show them to the user."},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End"},"reconciliation":{"anyOf":[{"$ref":"#/components/schemas/Reconciliation"},{"type":"null"}],"description":"Self-check against the statement's balances. null when the statement has no balance column."}},"type":"object","required":["format","currency","transactions","rows_read","rows_skipped","confidence","warnings"],"title":"StatementInfo"},"StatementTransaction":{"properties":{"index":{"type":"integer","title":"Index","description":"Position in the statement, starting at 0."},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"description":{"type":"string","title":"Description"},"amount":{"type":"number","title":"Amount","description":"Always positive; see `direction`."},"direction":{"type":"string","title":"Direction","description":"`debit` (money out), `credit` (money in) or `unknown`."},"balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Balance"},"kind":{"type":"string","title":"Kind","description":"What sort of transaction this is: `merchant`, `transfer_in`, `transfer_out` (person-to-person), `cash`, `fee`, `income`, `interest`, `refund`, `bill_payment` or `unknown`."},"counterparty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty","description":"The other person in a transfer, when the narration names them (capitalisation normalised)."},"payee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payee Id","description":"Stable id of that person within this statement: different spellings of one name share it."},"counterparty_bank":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty Bank","description":"The other person's bank or wallet, when shown."},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel","description":"`ibft`, `raast`, `wallet`, `transfer` or `card`."},"identified":{"type":"boolean","title":"Identified","description":"True when the merchant was identified with confidence of at least 0.9. Weaker guesses stay in `enrichment` (show them as \"possibly ...\") but are not used for categories, merchants or kinds."},"enrichment":{"$ref":"#/components/schemas/EnrichResult","description":"The same result `POST /v1/enrich` returns for this narration."}},"type":"object","required":["index","description","amount","direction","kind","identified","enrichment"],"title":"StatementTransaction"},"StoredTransaction":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id"},"transaction_date":{"type":"string","title":"Transaction Date"},"amount":{"type":"number","title":"Amount"},"currency":{"type":"string","title":"Currency"},"direction":{"type":"string","title":"Direction"},"status":{"type":"string","title":"Status"},"original_description":{"type":"string","title":"Original Description"},"merchant":{"$ref":"#/components/schemas/TxMerchant"},"enrichment_source":{"type":"string","title":"Enrichment Source","description":"`client` (sent with a merchant block) or `tanzim` (resolved by Merchant Intelligence)."},"payment_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Class","description":"One of: subscription_payment, recurring_bill, recurring_obligation, ordinary_purchase, unclassified, credit, failed, transfer, possible_duplicate. Null until analysed."},"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id","description":"The recurring relationship this transaction belongs to, if any."},"duplicate_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duplicate Of"}},"type":"object","required":["transaction_id","transaction_date","amount","currency","direction","status","original_description","merchant","enrichment_source"],"title":"StoredTransaction"},"Subscription":{"properties":{"subscription_id":{"type":"string","title":"Subscription Id"},"customer_id":{"type":"string","title":"Customer Id"},"merchant_id":{"type":"string","title":"Merchant Id"},"merchant_name":{"type":"string","title":"Merchant Name"},"merchant_resolved":{"type":"boolean","title":"Merchant Resolved","description":"False when Merchant Intelligence could not identify the merchant (grouped by cleaned description)."},"merchant_confidence":{"type":"number","title":"Merchant Confidence"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"category":{"type":"string","title":"Category","description":"One of: Entertainment, Software and SaaS, Music and Streaming, Gaming, Cloud Services, Telecommunications, Utilities, Insurance, Financial Services, Shopping and Retail, Food and Delivery, Transportation, Other."},"source_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Category","description":"The Merchant Intelligence category it was derived from."},"source_subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Subcategory"},"classification":{"type":"string","enum":["subscription","recurring_bill","recurring_obligation","recurring_payment"],"title":"Classification","description":"`subscription`, `recurring_bill` (utilities, telecom), `recurring_obligation` (insurance, EMIs, fees) or `recurring_payment` (a repeated purchase, not a commitment)."},"detection":{"type":"string","title":"Detection","description":"`confirmed_subscription` (confirmed by the observed payment history), `probable_subscription`, or `recurring_payment`. A payment pattern cannot prove a merchant-side contract exists."},"is_subscription":{"type":"boolean","title":"Is Subscription"},"frequency":{"type":"string","title":"Frequency","description":"One of: weekly, fortnightly, monthly, bimonthly, quarterly, semi_annual, annual, irregular."},"average_amount":{"type":"number","title":"Average Amount"},"last_amount":{"type":"number","title":"Last Amount"},"expected_amount":{"type":"number","title":"Expected Amount","description":"Expected next payment: the current price (after any price change), or the recent average for variable amounts."},"monthly_equivalent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Equivalent","description":"expected_amount converted to a month: weekly x 52/12, fortnightly x 26/12, quarterly / 3, ..."},"annualised_equivalent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annualised Equivalent"},"currency":{"type":"string","title":"Currency"},"amount_pattern":{"type":"string","title":"Amount Pattern","description":"`fixed`, `stepped` (price changed), `variable` (metered bills), or `fixed_in_original_currency` (only FX moved)."},"payment_count":{"type":"integer","title":"Payment Count"},"total_paid":{"type":"number","title":"Total Paid"},"first_observed_date":{"type":"string","title":"First Observed Date"},"last_payment_date":{"type":"string","title":"Last Payment Date"},"next_expected_payment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Expected Payment","description":"Estimate, not a guaranteed billing date."},"recurrence_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Recurrence Confidence","description":"How sure Tanzim is that the payment recurs at `frequency`, from the number of payments, interval regularity and amount stability."},"classification_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Classification Confidence","description":"How sure Tanzim is of `classification` (recurrence x merchant category evidence x merchant resolution confidence)."},"forecast_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Forecast Confidence"},"status":{"type":"string","enum":["active_pattern","observed_recurring","uncertain","inactive"],"title":"Status","description":"Estimated from the pattern: `active_pattern`, `observed_recurring` (too little history to say more), `uncertain` (the expected payment is late) or `inactive` (expected payments missed)."},"status_reason":{"type":"string","title":"Status Reason"},"included_in_totals":{"type":"boolean","title":"Included In Totals","description":"Counted in monthly/annualised expenditure (status active_pattern or observed_recurring)."},"price_changes":{"items":{"$ref":"#/components/schemas/PriceChange"},"type":"array","title":"Price Changes"},"irregularities":{"items":{"$ref":"#/components/schemas/Irregularity"},"type":"array","title":"Irregularities"},"failed_payment_count":{"type":"integer","title":"Failed Payment Count"},"as_of":{"type":"string","title":"As Of"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["subscription_id","customer_id","merchant_id","merchant_name","merchant_resolved","merchant_confidence","category","classification","detection","is_subscription","frequency","average_amount","last_amount","expected_amount","currency","amount_pattern","payment_count","total_paid","first_observed_date","last_payment_date","recurrence_confidence","classification_confidence","forecast_confidence","status","status_reason","included_in_totals","price_changes","irregularities","failed_payment_count","as_of"],"title":"Subscription"},"SubscriptionDetail":{"properties":{"subscription_id":{"type":"string","title":"Subscription Id"},"customer_id":{"type":"string","title":"Customer Id"},"merchant_id":{"type":"string","title":"Merchant Id"},"merchant_name":{"type":"string","title":"Merchant Name"},"merchant_resolved":{"type":"boolean","title":"Merchant Resolved","description":"False when Merchant Intelligence could not identify the merchant (grouped by cleaned description)."},"merchant_confidence":{"type":"number","title":"Merchant Confidence"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"category":{"type":"string","title":"Category","description":"One of: Entertainment, Software and SaaS, Music and Streaming, Gaming, Cloud Services, Telecommunications, Utilities, Insurance, Financial Services, Shopping and Retail, Food and Delivery, Transportation, Other."},"source_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Category","description":"The Merchant Intelligence category it was derived from."},"source_subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Subcategory"},"classification":{"type":"string","enum":["subscription","recurring_bill","recurring_obligation","recurring_payment"],"title":"Classification","description":"`subscription`, `recurring_bill` (utilities, telecom), `recurring_obligation` (insurance, EMIs, fees) or `recurring_payment` (a repeated purchase, not a commitment)."},"detection":{"type":"string","title":"Detection","description":"`confirmed_subscription` (confirmed by the observed payment history), `probable_subscription`, or `recurring_payment`. A payment pattern cannot prove a merchant-side contract exists."},"is_subscription":{"type":"boolean","title":"Is Subscription"},"frequency":{"type":"string","title":"Frequency","description":"One of: weekly, fortnightly, monthly, bimonthly, quarterly, semi_annual, annual, irregular."},"average_amount":{"type":"number","title":"Average Amount"},"last_amount":{"type":"number","title":"Last Amount"},"expected_amount":{"type":"number","title":"Expected Amount","description":"Expected next payment: the current price (after any price change), or the recent average for variable amounts."},"monthly_equivalent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Equivalent","description":"expected_amount converted to a month: weekly x 52/12, fortnightly x 26/12, quarterly / 3, ..."},"annualised_equivalent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annualised Equivalent"},"currency":{"type":"string","title":"Currency"},"amount_pattern":{"type":"string","title":"Amount Pattern","description":"`fixed`, `stepped` (price changed), `variable` (metered bills), or `fixed_in_original_currency` (only FX moved)."},"payment_count":{"type":"integer","title":"Payment Count"},"total_paid":{"type":"number","title":"Total Paid"},"first_observed_date":{"type":"string","title":"First Observed Date"},"last_payment_date":{"type":"string","title":"Last Payment Date"},"next_expected_payment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Expected Payment","description":"Estimate, not a guaranteed billing date."},"recurrence_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Recurrence Confidence","description":"How sure Tanzim is that the payment recurs at `frequency`, from the number of payments, interval regularity and amount stability."},"classification_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Classification Confidence","description":"How sure Tanzim is of `classification` (recurrence x merchant category evidence x merchant resolution confidence)."},"forecast_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Forecast Confidence"},"status":{"type":"string","enum":["active_pattern","observed_recurring","uncertain","inactive"],"title":"Status","description":"Estimated from the pattern: `active_pattern`, `observed_recurring` (too little history to say more), `uncertain` (the expected payment is late) or `inactive` (expected payments missed)."},"status_reason":{"type":"string","title":"Status Reason"},"included_in_totals":{"type":"boolean","title":"Included In Totals","description":"Counted in monthly/annualised expenditure (status active_pattern or observed_recurring)."},"price_changes":{"items":{"$ref":"#/components/schemas/PriceChange"},"type":"array","title":"Price Changes"},"irregularities":{"items":{"$ref":"#/components/schemas/Irregularity"},"type":"array","title":"Irregularities"},"failed_payment_count":{"type":"integer","title":"Failed Payment Count"},"as_of":{"type":"string","title":"As Of"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"merchant":{"$ref":"#/components/schemas/MerchantDetails"},"payment_history":{"items":{"$ref":"#/components/schemas/PaymentRecord"},"type":"array","title":"Payment History"},"amount_range":{"anyOf":[{"$ref":"#/components/schemas/AmountRange"},{"type":"null"}]},"forecast":{"anyOf":[{"$ref":"#/components/schemas/Forecast"},{"type":"null"}]}},"type":"object","required":["subscription_id","customer_id","merchant_id","merchant_name","merchant_resolved","merchant_confidence","category","classification","detection","is_subscription","frequency","average_amount","last_amount","expected_amount","currency","amount_pattern","payment_count","total_paid","first_observed_date","last_payment_date","recurrence_confidence","classification_confidence","forecast_confidence","status","status_reason","included_in_totals","price_changes","irregularities","failed_payment_count","as_of","merchant","payment_history"],"title":"SubscriptionDetail"},"SubscriptionList":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"as_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"As Of"},"analysed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysed At"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"},"subscriptions":{"items":{"$ref":"#/components/schemas/Subscription"},"type":"array","title":"Subscriptions"}},"type":"object","required":["customer_id","total","limit","offset","has_more","subscriptions"],"title":"SubscriptionList"},"Summary":{"properties":{"currency":{"type":"string","title":"Currency"},"transaction_count":{"type":"integer","title":"Transaction Count"},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End"},"days":{"type":"integer","title":"Days"},"total_debits":{"type":"number","title":"Total Debits","description":"All money out, including transfers."},"total_credits":{"type":"number","title":"Total Credits"},"net":{"type":"number","title":"Net","description":"total_credits - total_debits."},"spending":{"type":"number","title":"Spending","description":"Money out excluding person-to-person transfers."},"transfers_out":{"type":"number","title":"Transfers Out"},"transfers_in":{"type":"number","title":"Transfers In"},"income":{"type":"number","title":"Income","description":"Credits recognised as salary/payroll."},"average_daily_spending":{"type":"number","title":"Average Daily Spending"},"average_transaction":{"type":"number","title":"Average Transaction","description":"Average spending transaction."}},"type":"object","required":["currency","transaction_count","days","total_debits","total_credits","net","spending","transfers_out","transfers_in","income","average_daily_spending","average_transaction"],"title":"Summary"},"TransactionIn":{"properties":{"date":{"type":"string","title":"Date","description":"Transaction date: 2026-01-31, 31/01/2026 (day first), 31-Jan-2026 and similar are understood.","examples":["2026-01-31"]},"description":{"type":"string","maxLength":1000,"minLength":1,"title":"Description","description":"The narration exactly as the statement shows it.","examples":["POS/KHAADI PKG MALL LHR PK"]},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount","description":"Amount. A number (negative = debit when `direction` is omitted) or text such as \"1,250.00 Dr\" or \"(1,250.00)\".","examples":[1250.0]},"direction":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}],"title":"Direction","description":"If you know it. Otherwise it is inferred from the sign, a Dr/Cr marker or the balance."},"balance":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Balance","description":"Running balance after this transaction, if you have it. It makes direction detection and the self-check far more reliable."}},"type":"object","required":["date","description","amount"],"title":"TransactionIn"},"TransactionList":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"},"transactions":{"items":{"$ref":"#/components/schemas/StoredTransaction"},"type":"array","title":"Transactions"}},"type":"object","required":["customer_id","total","limit","offset","has_more","transactions"],"title":"TransactionList"},"TransactionsRequest":{"properties":{"transactions":{"items":{"$ref":"#/components/schemas/TransactionIn"},"type":"array","maxItems":5000,"minItems":1,"title":"Transactions"},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Za-z]{3}$"},{"type":"null"}],"title":"Currency","description":"ISO currency code, used for labelling only.","default":"PKR"}},"type":"object","required":["transactions"],"title":"TransactionsRequest"},"TransferSummary":{"properties":{"transfers":{"type":"integer","title":"Transfers"},"named":{"type":"integer","title":"Named","description":"Transfers where the statement names the other person."},"named_share":{"type":"number","title":"Named Share","description":"Many statements print only a reference, not a name: when this is low, `regular_unnamed_transfers` is the useful view."}},"type":"object","required":["transfers","named","named_share"],"title":"TransferSummary"},"TxMerchant":{"properties":{"merchant_id":{"type":"string","title":"Merchant Id"},"merchant_name":{"type":"string","title":"Merchant Name"},"resolved":{"type":"boolean","title":"Resolved"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subcategory"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["merchant_id","merchant_name","resolved","confidence"],"title":"TxMerchant"},"UnidentifiedItem":{"properties":{"description":{"type":"string","title":"Description"},"count":{"type":"integer","title":"Count"},"amount":{"type":"number","title":"Amount"}},"type":"object","required":["description","count","amount"],"title":"UnidentifiedItem"},"Upcoming":{"properties":{"next_7_days":{"items":{"$ref":"#/components/schemas/UpcomingPayment"},"type":"array","title":"Next 7 Days"},"next_30_days":{"items":{"$ref":"#/components/schemas/UpcomingPayment"},"type":"array","title":"Next 30 Days"},"note":{"type":"string","title":"Note"}},"type":"object","required":["next_7_days","next_30_days","note"],"title":"Upcoming"},"UpcomingPayment":{"properties":{"subscription_id":{"type":"string","title":"Subscription Id"},"merchant_name":{"type":"string","title":"Merchant Name"},"category":{"type":"string","title":"Category"},"classification":{"type":"string","title":"Classification"},"expected_date":{"type":"string","title":"Expected Date"},"days_until":{"type":"integer","title":"Days Until"},"estimated_amount":{"type":"number","title":"Estimated Amount"},"currency":{"type":"string","title":"Currency"},"forecast_confidence":{"type":"number","title":"Forecast Confidence"},"is_estimate":{"type":"boolean","title":"Is Estimate"}},"type":"object","required":["subscription_id","merchant_name","category","classification","expected_date","days_until","estimated_amount","currency","forecast_confidence","is_estimate"],"title":"UpcomingPayment"},"Usage":{"properties":{"last_24h":{"type":"integer","title":"Last 24H","description":"Transactions enriched with this key in the last 24 hours."}},"type":"object","required":["last_24h"],"title":"Usage"},"WebhookCreateRequest":{"properties":{"url":{"type":"string","maxLength":2000,"title":"Url","description":"Your HTTPS endpoint. It must be a public internet address (no localhost, private networks or redirects).","examples":["https://example.com/hooks/tanzim"]},"events":{"items":{"type":"string"},"type":"array","title":"Events","description":"Event types to receive, or `[\"*\"]` for all. See `GET /v1/events/types`.","default":["*"],"examples":[["subscription.renewal_due"]]},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Description","description":"A note for yourself."}},"type":"object","required":["url"],"title":"WebhookCreateRequest"},"WebhookDelivery":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"webhook_delivery"},"event_id":{"type":"string","title":"Event Id"},"event_type":{"type":"string","title":"Event Type"},"endpoint_id":{"type":"string","title":"Endpoint Id"},"status":{"type":"string","title":"Status","description":"`pending` (will be retried), `succeeded` or `failed` (gave up)."},"attempts":{"type":"integer","title":"Attempts"},"next_attempt_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Attempt At"},"last_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Status Code"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivered At"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","event_id","event_type","endpoint_id","status","attempts","created_at"],"title":"WebhookDelivery"},"WebhookDeliveryList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDelivery"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"WebhookDeliveryList"},"WebhookEndpoint":{"properties":{"id":{"type":"string","title":"Id","examples":["we_1a2b3c4d5e6f7a8b"]},"object":{"type":"string","title":"Object","default":"webhook_endpoint"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"active":{"type":"boolean","title":"Active","description":"False once deleted or switched off after repeated failures (`disabled_reason`)."},"disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disabled Reason","description":"`deleted` or `too_many_failures`."},"livemode":{"type":"boolean","title":"Livemode"},"created_at":{"type":"string","title":"Created At"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret","description":"The signing secret. Shown ONCE, when the endpoint is created or its secret rotated: store it now.","examples":["whsec_..."]}},"type":"object","required":["id","url","events","active","livemode","created_at"],"title":"WebhookEndpoint"},"WebhookEndpointList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookEndpoint"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"WebhookEndpointList"},"WebhookTestRequest":{"properties":{"type":{"type":"string","title":"Type","description":"`webhook.test` or any event type from `GET /v1/events/types`: a sample event of that type is sent.","default":"webhook.test","examples":["subscription.renewal_due"]}},"type":"object","title":"WebhookTestRequest"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"`Authorization: Bearer tz_test_...`","scheme":"bearer"},"APIKeyHeader":{"type":"apiKey","description":"Alternative to the Bearer header, for tools that can't set one.","in":"header","name":"X-API-Key"}}}}