API Consumption

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

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 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


    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


    client_credentials


    e46124f9-xxxx-xxxx-xxxx-xxxxxxxxxxxx


    Note: All Request Body Parameters will be provided by Westcon through mail communication

Sample Response:

    { 
     "token_type": "Bearer", 
     "expires_in": "3600", 
     "ext_expires_in": "3600", 
     "expires_on": "1562587331", 
     "not_before": "1562583431", 
     "resource": "e46124f9-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
     "access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxx" 
    }
  

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.