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.

    Instruction-on-Zid-connection(1)

    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.

    Instruction-on-Zid-connection-2 (1)

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

    Instruction-on-Zid-connection-3 (1)

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

    Instruction-on-Zid-connection-4 (1)

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

    Instruction-on-Zid-connection-5 (1)
  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.

    Instruction-on-Zid-connection-6 (1)

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

    Instruction-on-Zid-connection-7 (1)
  5. You need to make a request.
  6. 
    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.

    Instruction-on-Zid-connection-8 (1)

    To add a Zid store to API2Cart, you need to fill in the appropriate fields.

    Instruction-on-Zid-connection-9 (1)