{"openapi":"3.0.1","info":{"title":"account.proto","version":"v0.2.x"},"servers":[{"description":"SANDBOX ZAS API","url":"https://sml-sbzas.zalopay.vn/api"}],"paths":{"/api/zas/account/{timestamp}/{uid}/{type}/{label}":{"get":{"tags":["AccountService"],"summary":"Query information about accounts","operationId":"accountQuery","parameters":[{"name":"timestamp","in":"path","required":true,"schema":{"type":"string","format":"int64"}},{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","required":true,"schema":{}},{"name":"label","in":"path","required":true,"schema":{"$ref":"#/components/schemas/protobufAccountType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/protobufAccountQueryResponse"}}}}}}},"/api/zas/create-account":{"post":{"tags":["AccountService"],"summary":"Create accounts","operationId":"accountCreate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/protobufAccountCreateRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/protobufAccountCreateResponse"}}}}}}},"/api/zas/trans-process":{"post":{"tags":["TransactionService"],"summary":"Create accounts","operationId":"transProcess","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/protobufTransProcessRequest"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/protobufTransProcessResponse"}}}}}}},"/api/zas/transaction/{timestamp}/{trans_id}":{"get":{"tags":["TransactionService"],"summary":"Query information about accounts","operationId":"transQuery","parameters":[{"name":"timestamp","in":"path","required":true,"schema":{"type":"string","format":"int64"}},{"name":"trans_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/protobufTransQueryResponse"}}}}}}}},"components":{"schemas":{"protobufAccount":{"title":"Account","type":"object","properties":{"uid":{"title":"ZaloPay userId\nREQUIRED","type":"string"},"type":{"$ref":"#/components/schemas/protobufAccountType"},"label":{"type":"string","description":"You can use this field to describe this account's business\nfor example: cash, refund, ..."},"status":{"$ref":"#/components/schemas/protobufAccountStatus"},"created_time":{"title":"thời gian tài khoản được tạo","type":"string"},"balance":{"$ref":"#/components/schemas/protobufAccountBalance"},"extra":{"title":"Optional","type":"object","additionalProperties":{"type":"string"}}}},"protobufAccountQueryResponseData":{"title":"Account Query Response Data","type":"object","properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/protobufAccount"}}}},"protobufAccountCreateResponse":{"title":"Account Create Response","type":"object","properties":{"timestamp":{"title":"This field can be used to track request-reponse latencies","type":"string","format":"int64"},"error":{"$ref":"#/components/schemas/protobufError"},"data":{"$ref":"#/components/schemas/protobufAccountCreateResponseData"}}},"protobufAccountType":{"title":"Account Type","type":"string","default":"UNKNOWN","enum":["UNKNOWN","USER","BANK","MERCHANT"]},"protobufAccountCreateRequest":{"title":"Account Create Request","type":"object","properties":{"timestamp":{"title":"Optional\nThis field can be used to track request-reponse latencies","type":"string","format":"int64"},"uid":{"title":"ZaloPay userId, 1 uid - N acno\nREQUIRED","type":"string"},"type":{"$ref":"#/components/schemas/protobufAccountType"},"labels":{"type":"array","items":{"type":"string"}},"currency_code":{"title":"Optional, default is 704 (Vietnamese Dong)\nReference: https://en.wikipedia.org/wiki/ISO_4217","type":"integer","format":"int32"},"status":{"$ref":"#/components/schemas/protobufAccountStatus"},"extra":{"title":"Optional","type":"object","additionalProperties":{"type":"string"}}}},"protobufAccountQueryResponse":{"title":"Account Query Response","type":"object","properties":{"timestamp":{"title":"This field can be used to track request-reponse latencies","type":"string","format":"int64"},"error":{"$ref":"#/components/schemas/protobufError"},"data":{"$ref":"#/components/schemas/protobufAccountQueryResponseData"}}},"protobufError":{"title":"Error","type":"object","properties":{"code":{"title":"code = 0 means success","type":"integer","format":"int32"},"message":{"type":"string"},"extra":{"type":"object","additionalProperties":{"type":"string"}}}},"protobufAccountBalance":{"title":"Account Balance","type":"object","properties":{"currency_code":{"title":"Optional, default is 704 (Vietnamese Dong)\nReference: https://en.wikipedia.org/wiki/ISO_4217","type":"integer","format":"int32"},"current":{"title":"số tiền hiện tại","type":"string","format":"int64"},"frozen":{"title":"số tiền bị đóng băng","type":"string","format":"int64"},"trans":{"title":"số tiền đang bị lock (khi prepare thành công) để thực hiện giao dịch","type":"string","format":"int64"},"trans_frozen":{"title":"số tiền đang bị lock để thực hiện unfreeze frozen_balance","type":"string","format":"int64"},"last_trans_no":{"title":"trans_no cuối cùng tác động tới số dư","type":"string"},"last_trans_time":{"type":"string"}}},"protobufAccountCreateResponseData":{"title":"Account Create Response Data","type":"object","properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/protobufAccount"}}}},"protobufAccountStatus":{"title":"Account Status","type":"string","default":"ENABLED","enum":["ENABLED","DISABLED"]},"protobufOperationType":{"title":"Account Operation Type","type":"string","description":"- OP_OUT: giao dịch tiền ra\n - OP_IN: giao dịch tiền vào\n - OP_FREEZE: giao dịch đóng băng tiền\n - OP_UNFREEZE: giao dịch phá băng tiền\n - OP_UNFREEZE_OUT: giao dịch phá băng + tiền ra\n - OP_IN_FREEZE: giao dịch tiền vào + đóng băng tiền","default":"OP_UNKNOWN","enum":["OP_UNKNOWN","OP_OUT","OP_IN","OP_FREEZE","OP_UNFREEZE","OP_UNFREEZE_OUT","OP_IN_FREEZE"]},"protobufService":{"title":"Service Info","type":"object","properties":{"name":{"title":"system name","type":"string"},"version":{"title":"system version","type":"string"},"extra":{"type":"object","additionalProperties":{"type":"string"}}}},"protobufTransQueryResponseData":{"title":"Trans Query Response Data","type":"object","properties":{"trans_id":{"title":"transaction number of ZAS","type":"string"},"trans_status":{"$ref":"#/components/schemas/protobufTransStatus"},"account_prove":{"type":"string"}}},"protobufTransEnvironment":{"title":"Transaction Context Information","type":"object","properties":{"version":{"title":"Optional. Default v1.0","type":"string"},"service":{"$ref":"#/components/schemas/protobufService"},"flow_type":{"$ref":"#/components/schemas/protobufFlowType"},"timestamp":{"title":"REQUIRED\nThis field can be used to track request-reponse latencies","type":"string","format":"int64"},"data":{"title":"Optional for C&S\nTransContext-serialized data","pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","format":"byte"}}},"protobufTransProcessRequest":{"title":"Trans Process Request","type":"object","properties":{"timestamp":{"type":"string","format":"int64"},"trans_id":{"type":"string","description":"REQUIRED\ntransaction number gốc, tương ứng với transId của TPE,..."},"operations":{"type":"array","items":{"$ref":"#/components/schemas/protobufOperation"}},"environment":{"$ref":"#/components/schemas/protobufTransEnvironment"}}},"protobufTransStatus":{"title":"Trans Status","type":"string","default":"TRANS_STATUS_RECEIVED","enum":["TRANS_STATUS_RECEIVED","TRANS_STATUS_PROCESSING","TRANS_STATUS_DONE_SUCCESSFULL","TRANS_STATUS_DONE_FAILED"]},"protobufOperation":{"title":"Operation","type":"object","properties":{"type":{"$ref":"#/components/schemas/protobufOperationType"},"uid":{"title":"ZAS Account ID\nREQUIRED","type":"string"},"account_type":{"$ref":"#/components/schemas/protobufAccountType"},"label":{"title":"Label must be defined in associated version of Account Profile","type":"string"},"amount":{"title":"Số tiền tác động lên account này\nREQUIRED","type":"string","format":"int64"},"currency_code":{"title":"Optional, default is 704 (Vietnamese Dong)\nReference: https://en.wikipedia.org/wiki/ISO_421","type":"integer","format":"int32"},"extra":{"title":"Optional","type":"object","additionalProperties":{"type":"string"}}}},"protobufTransProcessResponseData":{"title":"Trans Process Response Data","type":"object","properties":{"trans_id":{"title":"transaction number of ZAS","type":"string"},"trans_status":{"$ref":"#/components/schemas/protobufTransStatus"},"account_prove":{"type":"string"},"extra":{"type":"object","additionalProperties":{"type":"string"}}}},"protobufFlowType":{"title":"Flow Type","type":"string","default":"FLOW_UNKNOWN","enum":["FLOW_UNKNOWN","FLOW_TOP_UP","FLOW_MONEY_TRANSFER","FLOW_PAYMENT","FLOW_PAYMENT_PROMO","FLOW_WITHDRAW","FLOW_IBFT_PAYMENT","FLOW_RED_PACKET","FLOW_ZPI_PAYMENT","FLOW_REFUND","FLOW_REFUND_PROMO","FLOW_REFUND_EXCLUDE_PROMO","FLOW_SETTLEMENT","FLOW_MERCHANT_PAYMENT","FLOW_MERCHANT_PAYMENT_TOTAL","FLOW_FINANCIAL_TRANSFER","FLOW_PAYMENT_CURRENCY_EXCHANGE"]},"protobufTransProcessResponse":{"title":"Trans Process Response","type":"object","properties":{"timestamp":{"title":"This field can be used to track request-reponse latencies","type":"string","format":"int64"},"error":{"$ref":"#/components/schemas/protobufError"},"data":{"$ref":"#/components/schemas/protobufTransProcessResponseData"}}},"protobufTransQueryResponse":{"title":"Trans Query Response","type":"object","properties":{"timestamp":{"title":"This field can be used to track request-reponse latencies","type":"string","format":"int64"},"error":{"$ref":"#/components/schemas/protobufError"},"data":{"$ref":"#/components/schemas/protobufTransQueryResponseData"}}}}}}