{"openapi":"3.1.0","info":{"title":"CrypTax API","description":"API for tax processing services for crypto brokers (Binance, Coinbase, Kraken).","version":"1.0.0"},"paths":{"/api/v1/health":{"get":{"tags":["system"],"summary":"Health Check","description":"Health check endpoint that verifies DB and Redis connectivity.","operationId":"health_check_api_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"503":{"description":"Service Unavailable - The server is currently unable to handle the request due to a temporary overloading or maintenance of the server."}}}},"/api/v1/jobs":{"post":{"summary":"Create Job","description":"Create a new tax processing job.","operationId":"create_job_api_v1_jobs_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponseBody"}}}},"503":{"description":"Service Unavailable - The server is currently unable to handle the request due to a temporary overloading or maintenance of the server."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Jobs","description":"List all jobs for an account holder.","operationId":"list_jobs_api_v1_jobs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"acc","in":"query","required":true,"schema":{"type":"string","description":"Account holder email","title":"Acc"},"description":"Account holder email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobListItem"},"title":"Response List Jobs Api V1 Jobs Get"}}}},"503":{"description":"Service Unavailable - The server is currently unable to handle the request due to a temporary overloading or maintenance of the server."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/{document_id}/download":{"get":{"summary":"Download Document","description":"Download a document by ID.","operationId":"download_document_api_v1_documents__document_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"503":{"description":"Service Unavailable - The server is currently unable to handle the request due to a temporary overloading or maintenance of the server."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"delete":{"summary":"Delete Job","description":"Delete a tax processing job and its associated data.","operationId":"delete_job_api_v1_jobs__job_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"204":{"description":"Successful Response"},"503":{"description":"Service Unavailable - The server is currently unable to handle the request due to a temporary overloading or maintenance of the server."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/bot-activity":{"post":{"summary":"Upload Bot Activity","description":"Upload Binance bot CSV files for a job and trigger delayed processing.","operationId":"upload_bot_activity_api_v1_jobs__job_id__bot_activity_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_bot_activity_api_v1_jobs__job_id__bot_activity_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"503":{"description":"Service Unavailable - The server is currently unable to handle the request due to a temporary overloading or maintenance of the server."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountingMethodEnum":{"type":"string","enum":["FIFO","LIFO","HIFO","LOFO"],"title":"AccountingMethodEnum"},"Body_upload_bot_activity_api_v1_jobs__job_id__bot_activity_post":{"properties":{"api_key":{"type":"string","title":"Api Key","description":"Exchange API Key"},"api_secret":{"type":"string","title":"Api Secret","description":"Exchange API Secret"},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"}},"type":"object","required":["api_key","api_secret","files"],"title":"Body_upload_bot_activity_api_v1_jobs__job_id__bot_activity_post"},"CountryEnum":{"type":"string","enum":["IE","JP","ES","US","GENERIC"],"title":"CountryEnum"},"DocumentInfo":{"properties":{"document_id":{"type":"string","title":"Document Id","description":"UUID that identifies the document in the system"},"document_type":{"type":"string","title":"Document Type","description":"Type of document"}},"type":"object","required":["document_id","document_type"],"title":"DocumentInfo"},"ExchangeEnum":{"type":"string","enum":["binance","coinbase","kraken"],"title":"ExchangeEnum"},"GenericInfo":{"properties":{"long_term_capital_gains_days":{"type":"integer","title":"Long Term Capital Gains Days","description":"Number of days to hold an asset to be considered long-term capital gains."},"accounting_method":{"$ref":"#/components/schemas/AccountingMethodEnum","description":"Accounting method applicable for this user's country of residence."}},"type":"object","required":["long_term_capital_gains_days","accounting_method"],"title":"GenericInfo"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobListItem":{"properties":{"job_id":{"type":"string","title":"Job Id"},"lang":{"$ref":"#/components/schemas/LangEnum"},"country":{"$ref":"#/components/schemas/CountryEnum"},"generic":{"anyOf":[{"$ref":"#/components/schemas/GenericInfo"},{"type":"null"}]},"exchange":{"$ref":"#/components/schemas/ExchangeEnum"},"year":{"type":"integer","title":"Year"},"fiat":{"type":"string","title":"Fiat"},"status":{"$ref":"#/components/schemas/JobStatusEnum"},"documents":{"items":{"$ref":"#/components/schemas/DocumentInfo"},"type":"array","title":"Documents","default":[]}},"type":"object","required":["job_id","lang","country","exchange","year","fiat","status"],"title":"JobListItem"},"JobRequestBody":{"properties":{"lang":{"$ref":"#/components/schemas/LangEnum","description":"Language used for the job. ISO 639-1.","default":"en"},"country":{"$ref":"#/components/schemas/CountryEnum","description":"Countries whose tax regulations apply for this job. ISO 3166-1 alpha-2 code."},"generic":{"anyOf":[{"$ref":"#/components/schemas/GenericInfo"},{"type":"null"}],"description":"Generic information applicable to the user's country of residence. MUST be included if country is GENERIC."},"exchange":{"$ref":"#/components/schemas/ExchangeEnum"},"year":{"type":"integer","title":"Year","description":"Tax year (cannot be in the future)."},"account_holder":{"type":"string","title":"Account Holder","description":"Account holder email."},"uid":{"type":"string","title":"Uid","description":"Account holder subscription / user Id."},"api_key":{"type":"string","title":"Api Key","description":"Exchange API Key."},"api_secret":{"type":"string","title":"Api Secret","description":"Exchange API Secret."},"fiat":{"type":"string","title":"Fiat","description":"Native fiat currency for this account holder."},"has_bot_activity":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Bot Activity","description":"Flag indicating if the job has Binance bot activity and requires uploading bot CSV files.","default":false}},"type":"object","required":["country","exchange","year","account_holder","uid","api_key","api_secret","fiat"],"title":"JobRequestBody"},"JobResponseBody":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"UUID that identifies the job in the system"}},"type":"object","required":["job_id"],"title":"JobResponseBody"},"JobStatusEnum":{"type":"string","enum":["pending","processing","done","error"],"title":"JobStatusEnum"},"LangEnum":{"type":"string","enum":["en","es","de","fr","it","ja","pt"],"title":"LangEnum"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}