# Use balance to purchase
```javascript
WXAPI.userLevelBuy(token, priceId, isAutoRenew, remark)
```
+ token current user login credentials
+ priceId charging item id (not membership level id, don’t make a mistake)
+ isAutoRenew Whether to automatically renew after expiration (deducted from the balance, insufficient balance will cause renewal failure), pass true / false. This parameter can be omitted, and the default value is false if not passed.
+ remark remark information, this parameter does not need to be passed
```json
{
"code": 20000,
"msg": "The available balance is insufficient, please top up first"
}
```
```json
{
"code": 0,
"msg": "success"
}
```
# Use third party payment
Based on the current balance information, calculate the amount you want to pay, initiate a three-party payment interface to complete the payment, and use `nextAction` to purchase the membership level.
["Detailed explanation of nextAction parameter usage"](https://www.yuque.com/apifm/doc/aetmlb)