# Customer/Auth

## Login

> version=0.0.1\
> bizType=customer.app.CustomerWebApiService.login\
> Guest Accessible

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Customer/Auth"}],"servers":[{"url":"https://prewppc-3.cmfbl.com/api","description":"PRE测试公司439"}],"security":[],"paths":{"/login/customer.app.CustomerWebApiService.login":{"post":{"summary":"Login","deprecated":false,"description":"version=0.0.1\nbizType=customer.app.CustomerWebApiService.login\nGuest Accessible","tags":["Customer/Auth"],"parameters":[{"name":"version","in":"header","description":"Version Number","required":true,"schema":{"type":"string"}},{"name":"companyId","in":"header","description":"Company ID, obtained through environment variables","required":true,"schema":{"type":"string"}},{"name":"trace","in":"header","description":"Random Tracking Code UUID","required":true,"schema":{"type":"string"}},{"name":"lang","in":"header","description":"Language","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"integer","description":"Registration and Login Methods: 1 Email, 2 Phone Number, 3 Customer Account"},"phoneArea":{"type":"string","description":"Phone Area Code; Required field when type is 2: Phone Number"},"loginName":{"type":"string","description":"Account: Email/Phone Number"},"device":{"type":"integer","description":"Login Device: 1=Mobile Web: H5, 2=PC Web: PC_Web, 3=System & Backend Registration: System, 4=Android Native App: Android, 5=iOS Native App: iOS, 6=HarmonyOS: HOS, 7=PC Windows Client: PC_Win, 8=PC Mac Client: PC_Mac, 9=Others"},"isThird":{"type":"boolean","description":"Is it a third party"},"verifyCode":{"type":"string","description":"Verification code"},"sendToken":{"type":"string","description":"Verification code sending ticket"},"loginPwd":{"type":"string","description":"Login password"},"bindThirdUserId":{"type":"string","description":"Bind third-party userId"},"thirdSource":{"type":"string","description":"Third-Party Sources: google, facebook, twitter…"},"googleCode":{"type":"string","description":"Google Verification Code"}},"required":["type","device","loginName","isThird"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"bizCode":{"type":"string","description":"Module identifier code"},"code":{"type":"string","description":"Status return code"},"msg":{"type":"string","description":"Status description"},"tm":{"type":"integer","format":"int64","description":"Processing time (milliseconds)"},"trace":{"type":"string","description":"Tracking code"},"msgParams":{"type":"string","description":"Placeholder parameter string in return description, multiple parameters separated by commas"},"data":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Customer ID"},"companyId":{"type":"integer","format":"int64","description":"Company"},"customerGroupId":{"type":"integer","format":"int64","description":"Customer group"},"customerNo":{"type":"string","description":"Customer account"},"kycAuditStatus":{"type":"integer","format":"int32","description":"Registration KYC audit status: 0 uncertified, jump to certification page, 1 pending review, 2 review passed, 3 review failed"},"kycAuditRemark":{"type":"string","description":"Registration KYC audit remarks, not empty if rejected"},"kycStatus":{"type":"integer","format":"int32","description":"KYC status, consistent with kycRemark: 1=unverified, 2=under review, 3=authentication failed, 4=authenticated, -1=''"},"kycRemark":{"type":"string","description":"KYC status name (1, \"unverified\", \"KYC configured but not submitted\"), (2, \"under review\", \"KYC configured and under review, at least one level under review\"), (3, \"authentication failed\", \"KYC configured and submitted KYC rejected, at least one level rejected\"), (4, \"authenticated\", \"KYC configured and all levels authenticated\"), (-1, \"\", \"KYC configured, multiple levels, partially authenticated\")"},"accountList":{"type":"object","description":"Trading Account List","properties":{}},"accountRemark":{"type":"string","description":"Whether the customer has a trading account note"},"loginPassStatus":{"type":"string","description":"Set password reminder flag, 1 for password required, 2 for not required"},"payPassStatus":{"type":"string","description":"Payment password existence status, 1 for non-existent, 2 for existent"},"email":{"type":"string","description":"Email"},"phone":{"type":"string","description":"Phone"},"phoneArea":{"type":"string","description":"Phone area code"},"name":{"type":"string","description":"Name"},"country":{"type":"string","description":"Country"},"type":{"type":"integer","format":"int32","description":"Group type <0 real, 1 demo, 2 guest>"},"deposit":{"type":"integer","format":"int32","description":"Depositable, 1 for depositable"},"withdraw":{"type":"integer","format":"int32","description":"Withdrawable, 1 for withdrawable"},"optional":{"type":"integer","format":"int32","description":"Customized flag 0 not added 1 added"},"activateStatus":{"type":"integer","format":"int32","description":"Activation status, 0 not activated, 1 activated"},"activateTime":{"type":"integer","format":"int64","description":"Activation time"},"companyKycStatus":{"type":"integer","format":"int32","description":"Company KYC account opening status, 1 for opened, 2 for not opened"},"status":{"type":"integer","format":"int32","description":"Status: 1 normal, 2 disabled, 3 deleted, 4 closed, 5 locked, 6 closing"},"thirdServerCode":{"type":"string","description":"Unique identifier from third-party system"},"source":{"type":"string","description":"Source"},"thirdLoginSource":{"type":"string","description":"Third-party login sources google, facebook, twitter"},"thirdUserId":{"type":"string","description":"Third-party userId"},"idCard":{"type":"string","description":"ID number"},"idCardType":{"type":"string","description":"ID type"},"thirdIntactMsg":{"type":"string","description":"Third-party login complete data"},"firstName":{"type":"string","description":"First name"},"lastName":{"type":"string","description":"Last name"},"isFund":{"type":"integer","format":"int32","description":"Whether a fund manager, 1 is yes, default 0 is no"},"assertPassStatus":{"type":"string","description":"Set fund password reminder flag, 1 requires setting password, 2 does not require"},"googleId":{"type":"integer","format":"int64","description":"Whether to enable MFA, greater than 0, enabled, otherwise not enabled"},"openAccountType":{"type":"integer","format":"int32","description":"Account type: 0. Individual 1. Enterprise "},"loginTime":{"type":"integer","format":"int64","description":"Login time"},"createTime":{"type":"integer","format":"int64","description":"Creation time"},"relationCustomerId":{"type":"integer","format":"int64","description":"Associated account id"},"companyType":{"type":"string","description":"Company type"},"registerSource":{"type":"integer","format":"int32","description":"Registration source"},"associationCompanyId":{"type":"integer","format":"int64","description":"Associated company Id"},"registerTime":{"type":"integer","format":"int64","description":"Registration Time"},"token":{"type":"string","description":"Authentication token"},"customerAgentMark":{"type":"string","description":"Customer Agent Identifier"}}},"ok":{"type":"boolean"},"fail":{"type":"boolean"}}}}},"headers":{}}}}}}}
```

## POST /thirdExt/switchAccount

> Switch Real Simulation Account

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Customer/Auth"}],"servers":[{"url":"https://prewppc-3.cmfbl.com/api","description":"PRE测试公司439"}],"security":[],"paths":{"/thirdExt/switchAccount":{"post":{"summary":"Switch Real Simulation Account","deprecated":false,"description":"","tags":["Customer/Auth"],"parameters":[{"name":"companyId","in":"header","description":"Company ID, obtained through environment variables","required":true,"schema":{"type":"string"}},{"name":"trace","in":"header","description":"Random Tracking Code UUID","required":true,"schema":{"type":"string"}},{"name":"token","in":"header","description":"Login Token","required":true,"schema":{"type":"string"}},{"name":"lang","in":"header","description":"Language","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{}}}},"headers":{}}}}}}}
```

## Reset Demo Account

> version=0.0.1\
> bizType=customer.app.CustomerDubboApiService.resetAccount

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Customer/Auth"}],"servers":[{"url":"https://prewppc-3.cmfbl.com/api","description":"PRE测试公司439"}],"security":[],"paths":{"/global/customer.app.CustomerDubboApiService.resetAccount":{"post":{"summary":"Reset Demo Account","deprecated":false,"description":"version=0.0.1\nbizType=customer.app.CustomerDubboApiService.resetAccount","tags":["Customer/Auth"],"parameters":[{"name":"companyId","in":"header","description":"Company ID, obtained through environment variables","required":true,"schema":{"type":"string"}},{"name":"trace","in":"header","description":"Random Tracking Code UUID","required":true,"schema":{"type":"string"}},{"name":"token","in":"header","description":"Login Token","required":true,"schema":{"type":"string"}},{"name":"lang","in":"header","description":"Language","required":true,"schema":{"type":"string"}},{"name":"version","in":"header","description":"Version Number","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{}}}},"headers":{}}}}}}}
```

## Customer registration

> version=0.0.1\
> bizType=customer.app.CustomerWebApiService.register\
> Guest access

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Customer/Auth"}],"servers":[{"url":"https://prewppc-3.cmfbl.com/api","description":"PRE测试公司439"}],"security":[],"paths":{"/register/customer.app.CustomerWebApiService.register":{"post":{"summary":"Customer registration","deprecated":false,"description":"version=0.0.1\nbizType=customer.app.CustomerWebApiService.register\nGuest access","operationId":"register","tags":["Customer/Auth"],"parameters":[{"name":"version","in":"header","description":"Version Number","required":true,"schema":{"type":"string"}},{"name":"companyId","in":"header","description":"Company ID, obtained through environment variables","required":true,"schema":{"type":"string"}},{"name":"trace","in":"header","description":"Random Tracking Code UUID","required":true,"schema":{"type":"string"}},{"name":"lang","in":"header","description":"Language","required":true,"schema":{"type":"string"}},{"name":"X-Forwarded-For","in":"header","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"type":"string","description":"Country"},"lang":{"type":"string","description":"Language information, default en-US"},"loginName":{"type":"string","description":"Account: email/phone number, used in conjunction with type"},"phoneArea":{"type":"string","description":"Mobile area code, used in conjunction with registration method, default +86"},"type":{"type":"integer","format":"int32","description":"Registration method: 1=email, 2=phone number","minimum":1,"maximum":3},"registerDevice":{"type":"string","description":"Registered device model"},"verifyCode":{"type":"string","description":"Verification code"},"sendToken":{"type":"string","description":"Verification code sending ticket"},"registerSource":{"type":"integer","format":"int32","minimum":1,"description":"Registration source: 1=mobile web: H5, 2=pc web: PC_Web, 3=system & backend registration: System, 4=Android native app: Android, 5=iOS native app: iOS, 6=HarmonyOS: HOS, 7=pc windows client: PC_Win, 8=pc mac client: PC_Mac, 9=other"},"utmSource":{"type":"string","description":"Advertising source (account opening link parameter source)"},"utmMedium":{"type":"string","description":"Advertising medium (account opening link parameter medium)"},"utmCampaign":{"type":"string","description":"Advertising campaign (account opening link parameter campaign)"},"utmContent":{"type":"string","description":"Advertising group (account opening link parameter content)"},"utmTerm":{"type":"string","description":"Keyword (account opening link parameter term)"},"customerGroupId":{"type":"integer","format":"int64","description":"Client group ID"},"tradeTypeCurrencyList":{"type":"array","description":"Game currency information","items":{"type":"object","properties":{"allCurrency":{"type":"string","description":"Asset currency information"},"tradeType":{"type":"string","description":"Game ID"}}},"maxItems":2147483647,"minItems":1},"openAccountType":{"type":"integer","format":"int32","description":"Account opening type: 0. Individual 1. Enterprise, default individual"},"pwd":{"type":"string","description":"Password, MD5 encryption"},"thirdServerCode":{"type":"string","description":"Unique identifier from third-party system"},"thirdServerSource":{"type":"string","description":"Third-party system source, such as: agent=agent"}},"required":["registerSource","type","country","loginName","sendToken","verifyCode"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"bizCode":{"type":"string","description":"Module identifier code"},"code":{"type":"string","description":"Status return code"},"msg":{"type":"string","description":"Status description"},"tm":{"type":"integer","format":"int64","description":"Processing time (milliseconds)"},"trace":{"type":"string","description":"Tracking code"},"msgParams":{"type":"string","description":"Placeholder parameter string in return description, multiple parameters separated by commas"},"data":{"type":"object","properties":{"customerNo":{"type":"string","description":"Customer account"},"list":{"type":"array","description":"KYC authentication list information","items":{"$ref":"#/components/schemas/KycAuthVO"}},"companyId":{"type":"integer","format":"int64","description":"Company ID"},"email":{"type":"string","description":"Email"},"phone":{"type":"string","description":"Phone"},"phoneArea":{"type":"string","description":"Phone area code"},"name":{"type":"string","description":"Name"},"loginPassStatus":{"type":"string","description":"Set password reminder flag, 1 for password required, 2 for not required"},"payPassStatus":{"type":"string","description":"Payment password existence status, 1 for non-existent, 2 for existent"},"customerGroupId":{"type":"integer","format":"int64","description":"Client group ID"},"country":{"type":"string","description":"Country"},"id":{"type":"integer","format":"int64","description":"Customer ID"},"optional":{"type":"integer","format":"int32","description":"Customized flag 0 not added 1 added"},"companyKycStatus":{"type":"integer","format":"int32","description":"Company KYC account opening status, 1 for opened, 2 for not opened"},"thirdServerCode":{"type":"string","description":"Unique identifier from third-party system"},"source":{"type":"string","description":"Source"},"capitalInStatus":{"type":"integer","format":"int32","description":"Deposit status: 1. Deposited, 2. Not deposited"},"openAccountType":{"type":"integer","format":"int32","description":"Account type: 0. Individual 1. Enterprise "},"companyType":{"type":"string","description":"Company type"},"associationCompanyId":{"type":"integer","format":"int64","description":"Associated company Id"},"registerTime":{"type":"integer","format":"int64","description":"Registration Time"},"apiCheckSwitch":{"type":"boolean","description":"API verification switch. true-verification is enabled"},"apiCheckRule":{"type":"string","description":"API Verification Rules. 1-Email; 2-SMS; 3-Google NFA; Enable multiple verifications at the same time, separated by commas."}}},"ok":{"type":"boolean"},"fail":{"type":"boolean"}}}}},"headers":{}}}}}},"components":{"schemas":{"KycAuthVO":{"type":"object","properties":{"levelCode":{"type":"string","description":"Level Code"},"openAccountType":{"type":"integer","format":"int32","description":"Account type: 0. Individual 1. Enterprise "},"levelName":{"type":"string","description":"Level Name"},"pathName":{"type":"string","description":"KYC Path Name"},"pathCode":{"type":"string","description":"KYC Path Code"},"elementList":{"type":"array","description":"KYC Information List","items":{"$ref":"#/components/schemas/KycAuthElementVO"}}}},"KycAuthElementVO":{"type":"object","properties":{"elementCode":{"type":"string","description":"KYC element code"},"elementName":{"type":"string","description":"KYC element name"},"showType":{"type":"string","description":"KYC element display type"},"extend":{"type":"string","description":"KYC element extended attribute"},"elementValue":{"type":"string","description":"KYC element value"},"elementValueInputGroup":{"type":"string","description":"KYC element value, combination"},"elementCodeInputGroup":{"type":"string","description":"KYC element code, combination"}}}}}}
```

## Get access token

> /global/thirdExt/randomKey\
> Exchange final access token with a temporary token

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Customer/Auth"}],"servers":[{"url":"https://prewppc-3.cmfbl.com/api","description":"PRE测试公司439"}],"security":[],"paths":{"/global/thirdExt/randomKey":{"post":{"summary":"Get access token","deprecated":false,"description":"/global/thirdExt/randomKey\nExchange final access token with a temporary token","operationId":"getSymbolBaseList","tags":["Customer/Auth"],"parameters":[{"name":"companyId","in":"header","description":"Company ID, obtained through environment variables","required":true,"schema":{"type":"string"}},{"name":"trace","in":"header","description":"Random Tracking Code UUID","required":true,"schema":{"type":"string"}},{"name":"token","in":"header","description":"Login Token","required":false,"schema":{"type":"string"}},{"name":"lang","in":"header","description":"Language","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","description":"Final access token"},"bizCode":{"type":"string","description":"Module identifier code"},"code":{"type":"string","description":"Status return code"},"msg":{"type":"string","description":"Status description"},"tm":{"type":"integer","format":"int64","description":"Processing time (milliseconds)"},"trace":{"type":"string","description":"Tracking code"},"msgParams":{"type":"string","description":"Placeholder parameter string in return description, multiple parameters separated by commas"},"ok":{"type":"boolean","description":"Success or not"},"fail":{"type":"boolean","description":"Exception or not"}},"required":["data"]}}},"headers":{}}}}}}}
```
