How to connect Zid to API2Cart?
This guide will show you how to connect Zid to API2Cart in just a few steps.
To integrate with the Zid platform, follow the instructions below.
Step 1: Create a Zid Application
To get the required credentials, you need a Zid developer account. Open the Zid Partner Dashboard, go to My Apps and create a new application.
When creating the application, Zid asks you to choose the application type. Select Private/Public Application, which is the first option.
Step 2: Configure the Application and Select Scopes
Fill in the required foundational fields for your application. Some fields must be filled out in both English and Arabic.
On the next page, you'll need to select your app's scopes and fill the description field. You can find the full list of necessary scopes for API2Cart methods in the table at the end of this guide. This page also contains the Client ID and Client Secret. Copy and securely store these credentials, as they are mandatory for the next steps.
Next, fill in the detailed information about the application.
On the next page, Webhook Subscriptions, you don't need to fill out anything
On the next page, you can configure a paid subscription for the application when needed.
Step 3: Prepare the Application for Installation
To install the application on a live store, it must first be approved by the Zid team. Until the application is approved, it can only be installed on a Development Store.
Before using the authorization URL for a Development Store, install the application once by clicking the installation button in the application dashboard (page Application Details ).
Step 4: Generate the Authorization URL
Generate the URL used to add the application to the store using the credentials from the previous steps.
https://oauth.zid.sa/oauth/authorize?client_id=<client_id>&redirect_uri=<callback_url>&response_type=code
The value of the redirect_uri parameter must be the application's Callback URL, not the Redirection URL displayed in the application dashboard.
Step 5: Authorize the Application and Obtain the Code
Open the generated authorization URL in a browser and grant the access requested by the application.
After authorization, Zid redirects to the Callback URL. The browser address bar will contain the authorization code.
Step 6: Exchange the Code for Tokens
Send the following server-to-server request to exchange the authorization code for tokens:
curl -X POST https://oauth.zid.sa/oauth/token \
-H 'Content-Type: application/json' \
-d '{
"grant_type": "authorization_code",
"client_id": <APP_ID>,
"client_secret": <APP_SECRET>,
"redirect_uri": <CALLBACK_URL>,
"code": <CODE>
}'
A successful response contains access_token, authorization, and refresh_token.
Step 7: Connect Zid to API2Cart
Open the API2Cart connection form and enter the corresponding Zid credentials and tokens.
Table of Required Zid OAuth Scopes for API2Cart Methods
Below is the comprehensive list of Zid OAuth scopes required to execute specific API2Cart methods.
| API2Cart Method | Required Zid OAuth Scopes |
|---|---|
cart.validate |
Account — Read |
account.cart.add |
Account — Read |
account.config.update |
Account — Read |
cart.delete |
— |
cart.info |
Account — Read; Inventory — Read |
cart.script.list |
Account — Read; Extra Addons — Read |
cart.script.add |
Account — Read; Extra Addons — Read & Write |
cart.script.delete |
Account — Read; Extra Addons — Read & Write |
cart.coupon.list |
Account — Read; Coupons — Read |
cart.coupon.count |
Account — Read; Coupons — Read |
cart.coupon.add |
Account — Read; Coupons — Read & Write; Products — Read; Countries & Cities — Read; Delivery Options — Read |
cart.coupon.condition.add |
Account — Read; Coupons — Read & Write; Products — Read; Countries & Cities — Read; Delivery Options — Read |
cart.coupon.delete |
Account — Read; Coupons — Read & Write |
product.count |
Account — Read; Products — Read |
product.list |
Account — Read; Products — Read |
product.info |
Account — Read; Products — Read |
product.add |
Account — Read; Products — Read & Write; Inventory — Read & Write |
product.update |
Account — Read; Products — Read & Write |
product.delete |
Account — Read; Products — Read & Write |
product.image.add |
Account — Read; Products — Read & Write |
product.image.update |
Account — Read; Products — Read & Write |
product.image.delete |
Account — Read; Products — Read & Write |
product.child_item.list |
Account — Read; Products — Read |
product.child_item.info |
Account — Read; Products — Read |
product.review.list |
Account — Read; Products — Read |
product.variant.add |
Account — Read; Products — Read & Write; Inventory — Read & Write |
product.variant.update |
Account — Read; Products — Read & Write; Inventory — Read & Write |
product.variant.delete |
Account — Read; Products — Read & Write |
product.variant.image.add |
Account — Read; Products — Read & Write |
product.variant.image.delete |
Account — Read; Products — Read & Write |
product.update.batch |
Account — Read; Products — Read & Write |
product.variant.add.batch |
Account — Read; Inventory — Read & Write; Products — Read & Write |
product.variant.update.batch |
Account — Read; Inventory — Read & Write; Products — Read & Write |
product.variant.delete.batch |
Account — Read; Products — Read & Write |
category.list |
Account — Read; Products — Read |
category.info |
Account — Read; Products — Read |
category.add |
Account — Read; Products — Read & Write |
category.update |
Account — Read; Products — Read & Write |
category.assign |
Account — Read; Products — Read & Write |
category.unassign |
Account — Read; Products — Read & Write |
order.count |
Account — Read; Orders — Read |
order.list |
Account — Read; Orders — Read; Countries & Cities — Read |
order.info |
Account — Read; Orders — Read; Countries & Cities — Read |
order.update |
Account — Read; Orders — Read & Write |
order.status.list |
Account — Read |
order.financial_status.list |
Account — Read |
order.abandoned.list |
Account — Read; Abandoned Carts — Read |
order.shipment.list |
Account — Read; Orders — Read |
order.shipment.info |
Account — Read; Orders — Read |
order.shipment.tracking.add |
Account — Read; Orders — Read & Write |
customer.count |
Account — Read; Customers — Read |
customer.list |
Account — Read; Customers — Read |
customer.info |
Account — Read; Customers — Read |
attribute.list |
Account — Read; Products — Read |
attribute.info |
Account — Read; Products — Read |
attribute.count |
Account — Read; Products — Read |
attribute.add |
Account — Read; Products — Read & Write |
attribute.update |
Account — Read; Products — Read & Write |
attribute.delete |
Account — Read; Products — Read & Write |
attribute.value.add |
Account — Read; Products — Read & Write |
attribute.value.update |
Account — Read; Products — Read & Write |
attribute.value.delete |
Account — Read; Products — Read & Write |
tax.class.info |
Account — Read; Vats — Read |
webhook.create |
Account — Read; Webhooks — Read & Write |
webhook.list |
Account — Read; Webhooks — Read |
webhook.count |
Account — Read; Webhooks — Read |
webhook.update |
Account — Read |
webhook.delete |
Account — Read; Webhooks — Read & Write |
webhook.events |
Account — Read |
batch.job.list |
Account — Read |
batch.job.result |
Account — Read |