API Consumption

API Operations can be performed from Developer portal and client applications with a few prerequisites and authentication processes.

The APIs can be consumed by following the steps mentioned below.

Developer portal

Client applications

test

Westcon API’s can be accessed by authorized client applications only.

The Westcon support team will register the application and provide the client credentials through which the client would
get an access token
to consume the API’s.

API call to get Access Token

  • Post

  • https://login.microsoftonline.com/ec8933c6-cfb2-4dd9-bfc9-621cde1dea8f/oauth2/token

  • x-www-form-urlencoded

  • xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    client_credentials

  • grant_type=client_credentials&client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&client_secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • {
        "token_type": "Bearer",
        "expires_in": 3599,
        "ext_expires_in": 3599,
        "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IkxQSmJr..."
    }

  • API call to get Order Status

    • Post

    • https://api.westconcomstor.com/Orders/orderStatus

    • This values should be a Bearer token which we received from Microsoft Login

      Developer can find this Subscription Key in Profile

      application/json

    • { 
        "mT_OrderStatus_API_REQ": { 
        "partnerKey": "0****************3",   
        "orderType": "W",   
        "language": "EN",   
        "order":[
                "6****4",
                "6****9"
                ]
       }
      }
                  

    Sample Response:

    {
      "MT_OrderStatus_Response": [{
          "eRPOrderNumber": "0********4",
          "eRPOrderLineNumber": "0****0",
          "customerOrderNumber": "Rb****-03",
          "customerLineNumber": "",
          "eRPProductNumber": "T****3",
          "lineQuantity": "         2.000",
          "unitOfMeasure": "EA",
          "lineStatusCode": "INV",
          "lineStatusDescription": "Invoiced",
          "statusDate": "yyyymmdd",
          "shipDate": "yyyymmdd",
          "billingDocument": "0*******7",
          "parentERPLine": "0****0"
        },
        {
          "eRPOrderNumber": "0********4",
          "eRPOrderLineNumber": "0****0",
          "customerOrderNumber": "Rb****03",
          "customerLineNumber": "",
          "eRPProductNumber": "T****3",
          "lineQuantity": "         2.000",
          "unitOfMeasure": "EA",
          "lineStatusCode": "INV",
          "lineStatusDescription": "Invoiced",
          "statusDate": "yyyymmdd",
          "shipDate": "yyyymmdd",
          "billingDocument": "0*******7",
          "parentERPLine": "0****0"
        },
        {
          "eRPOrderNumber": "0********9",
          "eRPOrderLineNumber": "000010",
          "customerOrderNumber": "VC REGULAR MFR SN",
          "customerLineNumber": "",
          "eRPProductNumber": "U************U",
          "lineQuantity": "         1.000",
          "unitOfMeasure": "EA",
          "lineStatusCode": "SHI",
          "lineStatusDescription": "Shipped",
          "statusDate": "yyyymmdd",
          "shipDate": "yyyymmdd",
          "billingDocument": "",
          "parentERPLine": "0****0"
        },
        {
          "eRPOrderNumber": "0********9",
          "eRPOrderLineNumber": "000020",
          "customerOrderNumber": "VC REGULAR MFR SN",
          "customerLineNumber": "",
          "eRPProductNumber": "C***********T",
          "lineQuantity": "         2.000",
          "unitOfMeasure": "EA",
          "lineStatusCode": "SHI",
          "lineStatusDescription": "Shipped",
          "statusDate": "yyyymmdd",
          "shipDate": "yyyymmdd",
          "billingDocument": "",
          "parentERPLine": "0****0"
        }
      ]
    }
      

    Sample Client application

  • Extract the code and change the configuration values as required in web.config file.
  •      Please click here to download the Source code.

  • Once the zip file is downloaded, extract the file and navigate to the web.config file.
  • Add the below configuration values in "appSettings" section of Web.config file.
  • Configuration values:
  •      < add key="client_id" value="3a****48-2**7-4**f-b**8-1****5d****9" />

         < add key="client_secret" value="GpR****B.z****X.*5:J****3IR****nR" />

         < add key="resource" value="e4****f9-b**f-4**7-a**b-e****e6****4" />

         < add key="subscriptionKey" value="bb****************************68" />

  • Build and Run the Solution.
  • Required fields for a successful order request

  • Partner Key: Include the partner key provided by Westcon.
  • Order Type:

             W: Westcon Order Number. Type in W, if you have the Westcon Order Number.

             C:  Customer Order Number. Type in C, if you have your own Customer Order Number.

  • Language: Select the required language.
  • Order Number: Include one or more Order Numbers in the Orders block. You cannot mix and match Customer and Westcon Order Numbers.