Wallet

Register

If the user's login result loginStatus is pinRequired or registerRequired, proceed with the registration process.

loginStatus
Description

pinRequired

Creates the user's wallet and registers the app.. Requires the user to input a PIN for the initial wallet creation. It is recommended to request the PIN input twice for verification.

registerRequired

Since this process registers the account of an already created wallet with the app, one PIN input is required for existing PIN verification.

Wepin provides a UI Library for receiving the user's PIN input. Use this library to receive the PIN from the user, and then use the result to proceed with the registration process. Refer to the PIN pad library list for each platform on the API overview page.

POST /v1/app/register HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

{
	"appId": "<String>",
	"userId": "<String>",
	"loginStatus": "pinRequired",
	"UVD": {
		"b64SKey": "<String>",
		"b64Data": "<String>",
	},
	"hint": {
		"length": 6,
		"data": "**11**",
	}
}

Request

Parameter

Name
Type
Description
Required

appId

String

O

userId

String

O

walletId

String

The user's wallet ID. Required when loginStatus is registerRequired.

X

loginStatus

String

O

UVD

Object

The encrypted value of the PIN entered by the user. This is obtained through the PIN Pad Library.

X

hint

Object

A hint related to the PIN entered by the user. This is obtained through the PIN Pad Library and is valid only when loginStatus is pinRequired. The hint is sent to the server and delivered to the user's email.

X

Response

Success Response

Name
Type
Description

success

Boolean

Success status

Error Response

Name
Type
Description

statusCode

Integer

Http status code value

timestamp

Timestamp

Time stamp value

path

String

Specifies which path (API) the error response is associated with.

message

String

Describes the error situation.

remainPinTryCnt

Integer

Returned when the entered PIN is incorrect, showing the number of remaining attempts for PIN verification.

If the response includes RemainPinTryCnt, it indicates that the PIN entered is incorrect. In this case, the client should provide an appropriate UI/UX to inform the user accordingly.


Changing User Wallet PIN

Users can change the PIN of their wallet. The nonce value in newUVD must be set as UVD's nonce + 1.

PATCH /v1/wallet/pin/change HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

{
	"UVD": {
		"b64SKey": "<String>",
		"b64Data": "<String>",
	},
	"newUVD": {
		"b64SKey": "<String>",
		"b64Data": "<String>",
	},
	"hint": {
		"length": 6,
		"data": "**11**",
	}
}

Request

Parameter

Name
Type
Description
Required

UVD

Object

User Verification Data. The encrypted value of the user's current PIN. This is obtained through the PIN Pad Library.

O

newUVD

Object

User Verification Data. The encrypted value of the user's new PIN. This is obtained through the PIN Pad Library.

O

hint

Object

A hint related to the user's entered PIN. This is obtained through the PIN Pad Library and sent to the server. The hint is then sent to the user's email.

O

Response

Success Response

Name
Type
Description

status

Boolean

Success status

Error Response

Name
Type
Description

statusCode

Integer

Http status code value

timestamp

Timestamp

Time stamp value

path

String

Specifies which path (API) the error response is associated with.

message

String

Describes the error situation.

remainPinTryCnt

Integer

Returned when the entered PIN is incorrect, showing the number of remaining attempts for PIN verification.

Reset PIN Try Count for User Wallet

Requests a reset of the user's wallet PIN try count value.

GET /v1/wallet/{walletId}/pin/reset-try-count?userId={userId} HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

userId

String

O

walletId

String

O

Response

Success Response

Name
Type
Description

status

Boolean

Success status

Error Response

Name
Type
Description

statusCode

Integer

Http status code value

walletId

String

The user's wallet ID.

maxTryCount

String

The maximum allowed PIN try count for the wallet.

remainPinTryCnt

Integer

Returned when the entered PIN is incorrect, showing the number of remaining attempts for PIN verification.

recvResetCmd

Boolean

/v1/wallet/{walletId}/pin/reset-try-count Indicates whether the operation was successful.

lockTime

String

The time remaining until the PIN try count is reset.

releaseTimestamp

String

The time when the user's PIN try count will be reset.


Verification of User Wallet PIN

Verifies the PIN number of the user's wallet.

After Resetting the user's Wallet PIN Try Count, the PIN verification process must be performed.

POST /v1/wallet/pin/verify HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

userId

String

O

walletId

String

The user's wallet ID.

O

UVD

UVD

User's UVD. Use the response value from PIN Pad Library - generateAuthPINBlock.

O

Response

Success Response

Name
Type
Description

status

string

Request success or failure ("success" or "fail")

walletId

string

The user's wallet ID.

pinVerified

boolean

PIN verification result

Error Response

Name
Type
Description

statusCode

Integer

Http status code value

timestamp

Timestamp

Time stamp value

path

String

Specifies which path (API) the error response is associated with.

message

String

Describes the error situation.

remainPinTryCnt

Integer

Returned when the entered PIN is incorrect, showing the number of remaining attempts for PIN verification.

Last updated