# Migrating from Karvy EWB GSP

{% hint style="info" %}
Karvy EWB GSP is acquired by ClearTax. The current Karvy APIs will be deprecated by 30th June 2020. Migrate now.
{% endhint %}

## **SAP CPI Customers**

If you are currently using Karvy iflow in your SAP CPI, you can migrate to ClearTax quickly by following the below steps.

### **Prerequisites**

1. ~~SAP EWB GSP Integration Guide (.pdf file).~~
2. ~~SAP Cloud Integration Platform - Integration Flow Content package (.zip file).~~
3. ~~SAP Cloud Integration Platform - Router Content package (.zip file).~~
4. ~~NIC server public key (Sandbox and Production) (.zip file).~~
5. Register ClearTax as GSP on NIC.
6. ClearTax GSP SSL certificate (Sandbox and Production) (.cer file).
7. Externalized Parameters (Sandbox and Production)

There is no change in points 1 to 4 above.

### Register ClearTax as GSP on NIC

For the list of sandbox GSTIN username and password, [click here](https://docs.cleartax.in/cleartax-docs/e-waybill-gsp-api/getting-started-with-gsp-ewb-api/sandbox-gstin-for-ewb-gsp).&#x20;

To register ClearTax as GSP in NIC portal for production, follow this guide:

{% content-ref url="getting-started-with-gsp-ewb-api/how-to-register-gsp-on-nic" %}
[how-to-register-gsp-on-nic](https://docs.cleartax.in/cleartax-docs/e-waybill-gsp-api/getting-started-with-gsp-ewb-api/how-to-register-gsp-on-nic)
{% endcontent-ref %}

### Download ClearTax GSP SSL certificate

You can download the SSL certificates below:

{% file src="<https://2888774781-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZ9fXxeBEm3pJiVldcu%2Fuploads%2FarPEAGlVT4dQF2LF39O8%2FEWB_GSP_SSL_Sandbox.cer?alt=media&token=cc1897e4-628a-4905-8633-46de287c4eb2>" %}
ClearTax EWB GSP Sandbox SSL
{% endfile %}

{% file src="<https://2888774781-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZ9fXxeBEm3pJiVldcu%2Fuploads%2FhcTkgenvGA3ofIbCaJLA%2Fwildcard.cleartax.in.cer?alt=media&token=28e68f7f-d4b1-4214-9044-79b234faa2cc>" %}
ClearTax EWB GSP Production SSL&#x20;
{% endfile %}

In case you need root certificate, you can download it from [here](https://docs.cleartax.in/cleartax-docs/e-waybill-gsp-api-reference#environments).

### **Obtain Externalized Parameters**

You need to change only 3 parameters: `karvyclient_secret`, `karvy_auth_url` and `karvy_ewaybill_url`.

#### **Sandbox**

Update the following parameters with the new values:

| Parameter            | Value                                                                                                                                                                                    |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| karvyclientid        | `<same karvyclientid as before>`                                                                                                                                                         |
| karvyclient\_secret  | `<please check your email or write to integrations-support@cleartax.in>`                                                                                                                 |
| karvy\_auth\_url     | <p><code><https://api-sandbox.clear.in/ewb-gsp/v1.03/auth></code></p><p></p><p><del><code><https://ewb-gsp-staging.internal.cleartax.co/ewb-sandbox/v1.03/authenticate></code></del></p> |
| karvy\_ewaybill\_url | <p><code><https://api-sandbox.clear.in/ewb-gsp/v1.03/ewayapi></code></p><p></p><p><del><code><https://ewb-gsp-staging.internal.cleartax.co/ewb-sandbox/v1.03/ewayapi></code></del></p>   |

#### **Production**

Update the following parameters with the new values:

| Parameter            | Value                                                                                                                                                   |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| karvyclientid        | `<same karvyclientid as before>`                                                                                                                        |
| karvyclient\_secret  | `<please write to integrations-support@cleartax.in>`                                                                                                    |
| karvy\_auth\_url     | <p><code><https://api.clear.in/ewb-gsp/v1.03/auth></code></p><p></p><p><del><code><https://ewb-gsp.cleartax.in/ewb/v1.03/authenticate></code></del></p> |
| karvy\_ewaybill\_url | <p><code><https://api.clear.in/ewb-gsp/v1.03/ewayapi></code></p><p></p><p><del><code><https://ewb-gsp.cleartax.in/ewb/v1.03/ewayapi></code></del></p>   |

The following parameters will remain the same in both sandbox and production.

| Parameter          | Value   |
| ------------------ | ------- |
| nicpkalias         | niccert |
| nic\_token\_expiry | 300     |

{% hint style="info" %}
Note: NIC public key alias value is alias you have entered as same as the alias of the NIC&#x20;public key certificate you deployed (niccert).
{% endhint %}

### Step by step guide

In your Subaccount > Applications > Subscriptions corresponding to your sandbox (pre-production), select the Web UI URL something like: `https://xxx-xxx.xxx.xxx.hana.ondemand.com/itspaces`

**Step 1** – Add and deploy keystore

To deploy keystore, in SCPI Web UI URL, go to Monitor > Manage Security > Keystore >&#x20;Add keystore (add an alias and select the ClearTax SSL certificate) > Deploy > Confirm.

![](https://2888774781-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZ9fXxeBEm3pJiVldcu%2F-M9KYRx5WtKpHGobTJFC%2F-M9Kd2D6XLuEgw-w3Ch8%2Fimage.png?alt=media\&token=0a5efd53-369c-4aa6-b0dd-6aac0e749383)

Note: To perform above operation, you need to be a tenant administrator with role&#x20;AuthGroup.Administrator.

**Step 2** – Test connection

To check the connectivity with GSP, in SCPI Web UI URL, go to Monitor > Manage&#x20;Security > Connectivity Tests > TLS > Enter the ClearTax EWB GSP base URL without https (`ewb-gsp-staging.internal.cleartax.co` for sandbox and `ewb-gsp.cleartax.in` for production) and port > Send. The reponse&#x20;should be successful.

![](https://2888774781-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZ9fXxeBEm3pJiVldcu%2F-M9Kd5V9mgJBY99PCtwT%2F-M9Kd_3IlksIYVuWHayB%2Fimage.png?alt=media\&token=2e8eb067-9c31-4bbc-8bdd-c0fed1bbe22a)

**Step 3** – Update and deploy GSP iflow

In SCPI Web UI URL, To update the GSP iflow, go to Design > select E-Waybill package > Artifacts > against the gsp iflow, click on actions icon > configure > Define the&#x20;externalized parameters as provided by ClearTax. Once parameters are&#x20;updated, click save and then deploy.

![](https://2888774781-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZ9fXxeBEm3pJiVldcu%2F-M9KYRx5WtKpHGobTJFC%2F-M9Kco5JQfxY0zw1ptSs%2Fimage.png?alt=media\&token=b15f9570-f43a-4bf3-8278-ceae4b696833)

![](https://2888774781-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZ9fXxeBEm3pJiVldcu%2F-M9Kd5V9mgJBY99PCtwT%2F-M9KeDObBD3dGqwsj4ex%2Fimage.png?alt=media\&token=a0d738ba-047c-4d0e-b49c-a9e7be911ee5)

After successful deployment, check the integration flows are in `Started` state by choosing&#x20;Monitor > Manage Integration Content.

![](https://2888774781-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZ9fXxeBEm3pJiVldcu%2F-M9KYRx5WtKpHGobTJFC%2F-M9KcaU-un4pO9ukPgLI%2Fimage.png?alt=media\&token=fed9a877-6bdf-4cbb-8227-f8004973106c)

**Step 4** – Add user credentials per GSTIN from NIC provided by your GSP.

In SCPI Web UI URL, To add user credentials, go to Monitor > Manage Security > Security Material > Add > User Credentials > Deploy.

![](https://2888774781-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZ9fXxeBEm3pJiVldcu%2F-M9Kd5V9mgJBY99PCtwT%2F-M9Kec0mJOuDYFmD5hXh%2Fimage.png?alt=media\&token=fbd9440d-4191-4973-811f-d555493985e7)

{% hint style="warning" %}
You can follow the same steps to configure production environment also.

We highly recommend you to test the entire flow with all scenarios in the sandbox environment before moving to production.
{% endhint %}

{% hint style="info" %}
In case there is any change in the API in the future, you will have to update the iFlow which will be provided by ClearTax.
{% endhint %}

### Error Codes

In case you have received an error code from NIC, you can check the description of the code here: <https://docs.ewaybillgst.gov.in/apidocs/api-error-codes-list.html>

## Other ERP or Mode

If you are using SAP but not CPI, OR if you are not using SAP, please follow this guide:

{% content-ref url="getting-started-with-gsp-ewb-api" %}
[getting-started-with-gsp-ewb-api](https://docs.cleartax.in/cleartax-docs/e-waybill-gsp-api/getting-started-with-gsp-ewb-api)
{% endcontent-ref %}
