{"openapi":"3.1.0","info":{"title":"mooola statement API","version":"1.0.0","description":"Send a bank statement PDF; get its transactions back as JSON or CSV, verified against the statement where possible."},"servers":[{"url":"https://parse.mooola.co.za"}],"security":[{"apiKey":[]}],"paths":{"/v1/parse":{"post":{"operationId":"parseStatement","summary":"Read one statement PDF","parameters":[{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"CSV instead of JSON. `Accept: text/csv` does the same."},{"name":"currency","in":"query","schema":{"type":"string","pattern":"^[A-Z]{3}$"},"description":"ISO 4217 currency to assume where the statement prints none."},{"name":"unverified","in":"query","schema":{"type":"string","enum":["include"]},"description":"Return a statement that cannot be verified, labelled `unverified`, instead of refusing it."},{"name":"X-Unverified","in":"header","schema":{"type":"string","enum":["include"]},"description":"The same as `unverified=include`."},{"name":"X-Statement-Password","in":"header","schema":{"type":"string"},"description":"The password of a protected PDF. Never stored."}],"requestBody":{"required":true,"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"The statement: verified, needing review, or (when asked for) unverified.","headers":{"x-quota-limit":{"description":"Statements per account per month on the free tier (300).","schema":{"type":"integer"}},"x-quota-remaining":{"description":"Statements left this month, after this request.","schema":{"type":"integer"}},"x-quota-reset":{"description":"When the allowance resets (UTC).","schema":{"type":"string","format":"date-time"}},"x-request-id":{"description":"Quote it when you contact us about a request.","schema":{"type":"string","format":"uuid"}},"x-statement-status":{"description":"CSV responses: the status.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Statement"}},"text/csv":{"schema":{"type":"string","description":"Columns: Account Number, Account Name, Account Type, Currency, Posting Date, Transaction Date, Value Date, Description, Reference, Money In, Money Out, Fee, Balance, Verified."}}}},"400":{"description":"Refused: INVALID_REQUEST.","headers":{"x-quota-limit":{"description":"Statements per account per month on the free tier (300).","schema":{"type":"integer"}},"x-quota-remaining":{"description":"Statements left this month, after this request.","schema":{"type":"integer"}},"x-quota-reset":{"description":"When the allowance resets (UTC).","schema":{"type":"string","format":"date-time"}},"x-request-id":{"description":"Quote it when you contact us about a request.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Refused: UNAUTHORIZED.","headers":{"x-quota-limit":{"description":"Statements per account per month on the free tier (300).","schema":{"type":"integer"}},"x-quota-remaining":{"description":"Statements left this month, after this request.","schema":{"type":"integer"}},"x-quota-reset":{"description":"When the allowance resets (UTC).","schema":{"type":"string","format":"date-time"}},"x-request-id":{"description":"Quote it when you contact us about a request.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Refused: TOO_LARGE.","headers":{"x-quota-limit":{"description":"Statements per account per month on the free tier (300).","schema":{"type":"integer"}},"x-quota-remaining":{"description":"Statements left this month, after this request.","schema":{"type":"integer"}},"x-quota-reset":{"description":"When the allowance resets (UTC).","schema":{"type":"string","format":"date-time"}},"x-request-id":{"description":"Quote it when you contact us about a request.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Refused: INVALID_FILE.","headers":{"x-quota-limit":{"description":"Statements per account per month on the free tier (300).","schema":{"type":"integer"}},"x-quota-remaining":{"description":"Statements left this month, after this request.","schema":{"type":"integer"}},"x-quota-reset":{"description":"When the allowance resets (UTC).","schema":{"type":"string","format":"date-time"}},"x-request-id":{"description":"Quote it when you contact us about a request.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Refused: TOO_MANY_PAGES, PASSWORD_REQUIRED, INCORRECT_PASSWORD, UNREADABLE, UNSUPPORTED_DOCUMENT, NOT_VERIFIED.","headers":{"x-quota-limit":{"description":"Statements per account per month on the free tier (300).","schema":{"type":"integer"}},"x-quota-remaining":{"description":"Statements left this month, after this request.","schema":{"type":"integer"}},"x-quota-reset":{"description":"When the allowance resets (UTC).","schema":{"type":"string","format":"date-time"}},"x-request-id":{"description":"Quote it when you contact us about a request.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Refused: RATE_LIMITED, QUOTA_EXCEEDED.","headers":{"x-quota-limit":{"description":"Statements per account per month on the free tier (300).","schema":{"type":"integer"}},"x-quota-remaining":{"description":"Statements left this month, after this request.","schema":{"type":"integer"}},"x-quota-reset":{"description":"When the allowance resets (UTC).","schema":{"type":"string","format":"date-time"}},"x-request-id":{"description":"Quote it when you contact us about a request.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Refused: INTERNAL.","headers":{"x-quota-limit":{"description":"Statements per account per month on the free tier (300).","schema":{"type":"integer"}},"x-quota-remaining":{"description":"Statements left this month, after this request.","schema":{"type":"integer"}},"x-quota-reset":{"description":"When the allowance resets (UTC).","schema":{"type":"string","format":"date-time"}},"x-request-id":{"description":"Quote it when you contact us about a request.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key (`mpk_…`) from https://developers.mooola.co.za."}},"schemas":{"Issue":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["BALANCE_MISMATCH","DIRECTION_UNCLEAR","DATE_UNCLEAR","ROWS_UNREADABLE","ACCOUNTS_UNCLEAR","NOTHING_TO_CHECK","NO_TRANSACTIONS","NOT_CHECKED"]},"message":{"type":"string","description":"Plain English, safe to show to your users."}}},"Error":{"type":"object","required":["error"],"properties":{"requestId":{"type":"string","format":"uuid"},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED","RATE_LIMITED","QUOTA_EXCEEDED","INVALID_REQUEST","INVALID_FILE","TOO_LARGE","TOO_MANY_PAGES","PASSWORD_REQUIRED","INCORRECT_PASSWORD","UNREADABLE","UNSUPPORTED_DOCUMENT","NOT_VERIFIED","INTERNAL"]},"message":{"type":"string"},"reason":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["BALANCE_MISMATCH","DIRECTION_UNCLEAR","DATE_UNCLEAR","ROWS_UNREADABLE","ACCOUNTS_UNCLEAR","NOTHING_TO_CHECK","NO_TRANSACTIONS","NOT_CHECKED"]},"message":{"type":"string","description":"Plain English, safe to show to your users."}},"description":"NOT_VERIFIED only: why the statement could not be verified."}}}}},"Transaction":{"type":"object","properties":{"postingDate":{"type":["string","null"],"format":"date","description":"The posting date."},"transactionDate":{"type":["string","null"],"format":"date","description":"The transaction date."},"valueDate":{"type":["string","null"],"format":"date","description":"The value date."},"description":{"type":["string","null"]},"reference":{"type":["string","null"]},"moneyInMinor":{"type":["integer","null"],"description":"Money into the account. In minor units (cents)."},"moneyOutMinor":{"type":["integer","null"],"description":"Money out of the account, as a positive amount. In minor units (cents)."},"feeMinor":{"type":["integer","null"],"description":"A fee printed with the transaction. In minor units (cents)."},"balanceMinor":{"type":["integer","null"],"description":"The running balance after the transaction. In minor units (cents)."},"verified":{"type":"boolean","description":"True when this transaction was checked against the statement's own figures (balances or totals); false when it was inferred. In an unverified result, keep the true ones or send the false ones for review."}}},"Account":{"type":"object","properties":{"accountNumber":{"type":"string"},"accountName":{"type":["string","null"]},"accountType":{"type":["string","null"]},"branchCode":{"type":["string","null"]},"currency":{"type":"string","description":"ISO 4217, or XXX when unknown."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}}}},"Statement":{"type":"object","required":["schemaVersion","requestId","status","warnings","statement","accounts"],"properties":{"schemaVersion":{"const":1},"requestId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["verified","needs_review","unverified"]},"reason":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["BALANCE_MISMATCH","DIRECTION_UNCLEAR","DATE_UNCLEAR","ROWS_UNREADABLE","ACCOUNTS_UNCLEAR","NOTHING_TO_CHECK","NO_TRANSACTIONS","NOT_CHECKED"]},"message":{"type":"string","description":"Plain English, safe to show to your users."}},"description":"unverified only: why it could not be verified."},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Issue"},"description":"needs_review: what did not check out."},"statement":{"type":"object","properties":{"bank":{"type":"string","description":"A supported bank code, or \"other\"."},"statementNumber":{"type":["string","null"]},"statementDate":{"type":["string","null"],"format":"date","description":"The statement date."},"periodStart":{"type":["string","null"],"format":"date","description":"The first day the statement covers."},"periodEnd":{"type":["string","null"],"format":"date","description":"The last day the statement covers."},"accountHolder":{"type":["string","null"]},"openingBalanceMinor":{"type":["integer","null"],"description":"The opening balance printed. In minor units (cents)."},"closingBalanceMinor":{"type":["integer","null"],"description":"The closing balance printed. In minor units (cents)."},"totalMoneyInMinor":{"type":["integer","null"],"description":"Total money in. In minor units (cents)."},"totalMoneyOutMinor":{"type":["integer","null"],"description":"Total money out. In minor units (cents)."}}},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}}}}