Skip to main content

setStorageItem

Description

Store data into the storage in the form key: value

Parameters

ParamData typeRequiredDescription
appIdnumberYesID of the mini app, registered via Merchant Portal
keystringYesKey of the data needs to be stored
valuestringYesValue of the data needs to be stored

Return Value

N/A

Error Code

Error CodeDescription
020101Memory 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" }