This guide will show you how to connect Zid to API2Cart in just a few steps.

To integrate with Zid platform, you need to follow this instruction.

  1. In order to get the needed credentials, you need to have a Zid developer account https://partner.zid.sa/.
  2. It is necessary to create an application.

    connect Zid to API2Cart

    All information can be filled in English and Arabic.

    Instruction on zid connection 1

    It is required to select the necessary scopes. It is recommended to select all permissions because, in case of their change, you will need to get all tokens again. The page below contains the Client ID and Client Secret that will be needed to receive the tokens.

    Necessary scopes

    Next, you need to fill in detailed information about the application.

    Information about the application

    There is no need to fill in anything on the following page.

    Instruction on zid connection 4

    On this page, if necessary, you can set up a paid subscription to the application.

    Subscription to the application
  3. It is necessary to generate a URL for adding the application to the store, using the data from the previous step.
  4. https://oauth.zid.sa/oauth/authorize?client_id=&redirect_uri=&response_type=code

    After that, you need to use the mentioned URL in the browser. It is necessary to provide the access requested by the application.

    Mentioned URL

    As a result, it should redirect to the Redirect URL. You will see the code in the browser line.

    Redirect URL
  5. You need to make a request.
  6. EXAMPLE REQUEST
    curl -X POST https://oauth.zid.sa/oauth/token \
    -H 'Content-Type: application/json' \ 
    -d '{
      "grant_type": "authorization_code",
      "client_id": ,
      "client_secret": , 
      "redirect_uri": ,
      "code": 
    }'

    The result of the request will be access_token, authorization and refresh_token.

    Zid Authorization

    To connect Zid store via API2Cart, you need to fill in the appropriate fields.

    Connect zid to api2cart