# [Zibal](https://zibal.ir) Platform NPM Module

Here is Zibal Platform's NPM Module to Easily Manage your Wallets and Reports from Zibal Platform.

See Also [Zibal IPG](https://npmjs.com/package/zibal)


## Get Started
1. Install Module using `npm` or `yarn`
    ```
    npm install zibal-platform --save
    ```
2. Configure Module 

    ```javascript
    const ZibalPlatform = require("zibal-platform");
    
    
    const zibalPlatform = new ZibalPlatform({
        token: "YOUR_API_TOKEN" // Enter your API Token Here
    })
    ```
    
3. Make Requests and Have Fun
    #### Creating Wallet
    ```javascript
    zibalPlatform.createWallet({
       name: "TEST_WALLET"
    }).then(response => {
      // Success  
    }, error => {
       // Error
    })
    ```
    
    #### Get Wallet Balance
    ```javascript
    zibalPlatform.walletBalance({
       id: 100000 // Your Wallet's ID 
    }).then(response => {
      // Success  
    }, error => {
       // Error
    })
    ```
    
    #### Submit Checkout Request
    ```javascript
    zibalPlatform.walletCheckout({
       amount: 10000,
	   id: 10101,
	   bankAccount : "IR060180000000000000020600",
	   checkoutDelay: 1,
       description: "تسویه بابت حقوق آقای فرهادی"
    }).then(response => {
      // Success  
    }, error => {
       // Error
    })
    ```
    
    |Functions|
    |----|
    |createSubmerchant|
    |submerchantList|
    |editSubmerchant|
    |createWallet|
    |walletBalance|
    |walletCheckout|
    |checkoutQueue|
    |checkoutReport|
    
    See [Documentation](https://docs.zibal.ir/IPG/API) For More Requests.
    

4. Done


