{"openapi":"3.1.0","info":{"title":"YU Bank API v3","version":"3.0.0","description":"Đọc lịch sử giao dịch đã chuẩn hóa. Token được cấp riêng cho từng tài khoản ngân hàng và chỉ được dùng ở máy chủ."},"servers":[{"url":"https://bank.yu.com.vn","description":"Domain hiện tại"}],"paths":{"/v3/{bank}/transhistory/{token}":{"get":{"operationId":"getTransactionHistory","summary":"Lấy lịch sử giao dịch","description":"Trả tối đa 500 giao dịch mới nhất của tài khoản gắn với token.","parameters":[{"name":"bank","in":"path","required":true,"description":"Mã ngân hàng, ví dụ acb, vietcombank hoặc vpbank.","schema":{"type":"string","example":"vietcombank"}},{"name":"token","in":"path","required":true,"description":"Token API của đúng tài khoản. Không đưa token vào mã phía trình duyệt.","schema":{"type":"string","minLength":20,"example":"YOUR_ACCOUNT_TOKEN"}},{"name":"limit","in":"query","required":false,"description":"Số bản ghi, từ 1 đến 500. Mặc định 20.","schema":{"type":"integer","minimum":1,"maximum":500,"default":20}}],"responses":{"200":{"description":"Lấy dữ liệu thành công.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionHistoryResponse"}}}},"403":{"description":"Tài khoản, thành viên hoặc đại lý đang bị khóa.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Token không tồn tại hoặc không đúng ngân hàng.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"Transaction":{"type":"object","required":["id","transaction_date","account_number","transfer_type","amount_in","amount_out","amount"],"properties":{"id":{"type":["string","null"],"example":"tx_01JABC"},"transaction_date":{"type":["string","null"],"example":"2026-08-20 19:30:00"},"account_number":{"type":["string","null"],"example":"2038888888"},"transfer_type":{"type":["string","null"],"example":"in"},"amount_in":{"type":"integer","example":500000},"amount_out":{"type":"integer","example":0},"amount":{"type":"integer","example":500000},"accumulated":{"type":"integer","example":12500000},"description":{"type":["string","null"],"example":"THANH TOAN DON DH1024"},"reference_number":{"type":["string","null"],"example":"FT26081234567890"},"code":{"type":["string","null"]},"bank_brand_name":{"type":["string","null"],"example":"Vietcombank"}}},"TransactionHistoryResponse":{"type":"object","required":["ok","status","source","provider","bank","account_number","transactions"],"properties":{"ok":{"type":"boolean","const":true},"status":{"type":"integer","const":200},"source":{"type":"string","example":"apibank_v3"},"provider":{"type":"string","example":"bankhub"},"bank":{"type":"string","example":"Vietcombank"},"account_number":{"type":"string","example":"2038888888"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}}}},"ErrorResponse":{"type":"object","required":["ok","code","msg"],"properties":{"ok":{"type":"boolean","const":false},"code":{"type":"string","example":"TOKEN_NOT_FOUND"},"msg":{"type":"string","example":"Token v3 không tồn tại hoặc không đúng ngân hàng."}}}}}}