setStorageItem
Description
Store data into the storage in the form key: value
Parameters
Param | Data type | Required | Description |
---|---|---|---|
appId | number | Yes | ID of the mini app, registered via Merchant Portal |
key | string | Yes | Key of the data needs to be stored |
value | string | Yes | Value of the data needs to be stored |
Return Value
N/A
Error Code
Error Code | Description |
---|---|
020101 | Memory capacity is full |
Sample Code and Sample Return Data
Sample Request:
window.zlpSdk.Storage
.setStorageItem({ appId: -9999, key: 'datacodeId', value: 'DC10' })
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));
Sample Response:
{ data: {}, status: "success" }