# Web config

You must have an online store (Woocommerce), if not do it first then get back and continue

### Step 1: Wordpress config

If you’re using non-pretty permalinks WooCommerce REST API will not work. Config pretty permalinks in Settings > Permalinks so that the custom endpoints are supported.

![](https://3309432529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Wv-V9WSwhK3zwcNBL%2F-M4Wzyo7eAQ63GXlUhTF%2F-M4X0QyD1eqtT9NYqhQL%2FImage.png?alt=media\&token=b04ee785-5691-43b1-ae3e-d559c452241b)

### Step 2: Woocommerce config

Pre-generated keys can be used to authenticate use of the REST API endpoints. New keys can be generated either through the WordPress admin interface or they can be auto-generated through an endpoint.

#### Generating API keys in the WordPress admin interface

To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > Advanced => REST API

![](https://3309432529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Wv-V9WSwhK3zwcNBL%2F-M4Wzyo7eAQ63GXlUhTF%2F-M4X4hRCFdjjugyzVKDS%2FImage.png?alt=media\&token=1b2d1bac-c595-4064-97f3-f52707a39d04)

Choose the level of access for this REST API key, which can be Read access, Write access or Read/Write access. Then click the "Generate API Key" button and WooCommerce will generate REST API keys for the selected user.

Click the "Add Key" button. In the next screen, add a description and select the WordPress user you would like to generate the key for. Use of the REST API with the generated keys will conform to that user's WordPress roles and capabilities.

![](https://3309432529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Wv-V9WSwhK3zwcNBL%2F-M4Wzyo7eAQ63GXlUhTF%2F-M4X3_JFfAzxerjlzMok%2FImage.png?alt=media\&token=0ff342ff-b023-42f4-a0ae-b6b9ff772595)

Now that keys have been generated, you should see **consumerKey and consumerSecret.**

![](https://3309432529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Wv-V9WSwhK3zwcNBL%2F-M4Wzyo7eAQ63GXlUhTF%2F-M4X5qf36UC1PrL2Olpj%2FImage.png?alt=media\&token=732b4f7d-2284-4e54-8d45-65ab420e5614)

\*\*\*\* **API keys** are not transferred to other users.

**Tutorial Video**

{% embed url="https://youtu.be/8vjZyTOlztQ" %}

**Turn on payment gateway for WooCommerce**

To turn on stripe and paypal gateway for WooCommerce, go to WooCommerce > Settings > Payments

![](https://3309432529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Wv-V9WSwhK3zwcNBL%2F-M63Cs3L1iQHtVqbIokN%2F-M63IdTND6WdpzJvyGyz%2Fimage.png?alt=media\&token=c4956258-ee9b-4772-9cf3-bcafdad80735)

Click Manage button to advance configuration for each payment gateway

### Step 3: Install ZiniStoreAPI plugin

Install this plugin to your web store.

![](https://3309432529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Wv-V9WSwhK3zwcNBL%2F-M4XYMa73x4BrS-3gkoa%2F-M4XYgOjQkBQb7dT1VP0%2Fpicturemessage_lhrubexz.1qn.png?alt=media\&token=b0af10d2-aa84-47bf-acb2-f43dcbfd12c4)

#### Then open App control

&#x20;Click to `settings` under plugin name

![](https://3309432529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Wv-V9WSwhK3zwcNBL%2F-M4XYMa73x4BrS-3gkoa%2F-M4XZXJPjfpx_4FJP5oF%2FImage.png?alt=media\&token=b62f827e-20c9-4b16-b606-65c5732d4830)

#### Add config

Open file `wp-config.php` and add this config, don't forget change `xxxxxxxxxxx` with your content. This file is located in the root of your WordPress file directory and contains your website’s base configuration details, such as database connection information.

```
define('JWT_AUTH_SECRET_KEY', 'xxxxxxxxxxx'); // It like password, type any string you own
define('FB_APP_ID', 'xxxxxxxxxxx');
define('FB_APP_SECRET', 'xxxxxxxxxxx');
```

#### Step 4: Enable user register

![](https://3309432529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Wv-V9WSwhK3zwcNBL%2F-M4Wzyo7eAQ63GXlUhTF%2F-M4X8Uv_CPEA6LJBAxma%2FImage.png?alt=media\&token=39beb98d-9475-4b7c-9233-20900f671b8c)
