/
Woocommerce Frontend and Backend Integration

Woocommerce Frontend and Backend Integration

Step 1 : Create connection

Enter Store Name :

image-20240221-111651.png

API called: http://localhost:8080/_ah/api/esb/v1/connection/start

 

Case 1: When connection got created

Request Body:

{     "appId": 658,     "installationId":1162,     "authFields": {         "store_name" :"mayurkarwa123.wpcomstaging.com"     },     "connectionName": "Woocommerce" }


Response Body :

{     "id": 4175,     "appId": 658,     "installationId": 1162,     "authFields": {         "store_name": "mayurkarwa123.wpcomstaging.com"     },     "authorizeUrl": "https://mayurkarwa123.wpcomstaging.com/wc-auth/v1/authorize?scope=read_write&app_name=eshopbox&user_id=4175&return_url=https://electronicsell.auperator.co/dashboard/overview&callback_url=https://appinstall-dot-esb-integration-engine-staging.appspot.com/api/esb/v1/woocommerce/callbackurl",     "connectionName": "Woocommerce",     "isSellerOfRecord": "0"


Case 2 : If the entered Woocommerce store URL is not unique across all Eshopbox workspaces

This store URL is already connected with Eshopbox in a different workspace.

 

image-20240221-120703.png

 

Request Body :

{     "appId": 658,     "installationId":1162,     "authFields": {         "store_name" :"mayurkarwa123.wpcomstaging.com"     },     "connectionName": "Woocommerce" }


Response Body :

{     "error": {         "errors": [             {                 "domain": "global",                 "reason": "badRequest",                 "message": "This store URL is already connected with Eshopbox in a different workspace. Please disconnect before trying to connect it in this workspace."             }         ],         "code": 400,         "message": "This store URL is already connected with Eshopbox in a different workspace. Please disconnect before trying to connect it in this workspace."     } }

 

Case 3 : This store URL is already connected with your Eshopbox workspace.

 

image-20240221-120742.png

 

Response Body :

{     "error": {         "errors": [             {                 "domain": "global",                 "reason": "badRequest",                 "message": "This store URL is already connected with your Eshopbox workspace"             }         ],         "code": 400,         "message": "This store URL is already connected with your Eshopbox workspace"     }


Case 4 :

image-20240221-123528.png

 

  • If the user denies access during the authorization step redirect back to the workspace with a pre-filled store URL and display an error message.

    • Error Message: "Error in establishing the connection. You didn't authorize Eshopbox to access the Woocommerce store."

      If we receieve success = 0 appended in return url then , please throw the above error.

Case 4: If Currency is not in INR :
Error :

image-20240228-061752.png

Also, on check now it should go on the store url - https://mayurkarwa123.wpcomstaging.com/wp-admin/admin.php?page=wc-settings it should open this page where (mayurkarwa123.wpcomstaging.com) is the store url which we get in rthe inputFields.




UserId - Is connectionId

 

 

Related content