REST APIs

Softchoice REST APIs

Overview

Softchoice offers a suite of REST APIs designed to provide seamless integration capabilities. Our APIs deliver the tools you need to integrate efficiently with your existing workflows.

Current Available APIs include:

  • Order API - submit order
  • Product catalog API – retrieve pricing & availability

We are continually expanding our API offerings to meet evolving needs.

These APIs are available through this API Developer Portal which provides secure access, documentation and tools to get you started quickly.

Softchoice OAuth2 Authentication

Overview

See Figure 1 for calling APIs using access token.

resources/rest_api_authentication_001-24ad5063-0270-4f27-bff3-39299f25b186.png
Figure 1

Interactive Online Documentation for Softchoice Token Service

For a detailed explanation of how to retrieve access tokens and use them to call protected API endpoints, please access the Softchoice API authentication. (Figure 1.2)

Here you can explore all the token service endpoints, try with the live service, and test OAuth2 authentication against the ‘Echo’ endpoint using the retrieved tokens.

resources/rest_api_authentication_003-1cc86e0c-7054-450c-9847-e2e22dd521b4.png
Figure 1.2

Step to Implement Authentication in Your Application Logic

To implement OAuth2 authentication for Softchoice APIs:

  1. Implement logic to retrieve access tokens from the Softchoice OAuth2 token service. Since rate limits are enforced on the token endpoint, ensure tokens are cached and reused during their lifespan. The specifications for the implementation can be found below in “Softchoice OAuth2 Specification"
  2. Implement your application logic to consume Softchoice protected endpoints. Authentication uses OAuth2 protocol and requires an authorization header containing the access token retrieve in the previous step.
Softchoice OAuth2 Specification

resources/rest_api_authentication_004-ef6f8755-92a6-44a9-9f67-dec8b3612e42.png

Request and Response Samples
Sample Token Request

POST https://softchoice-authentication-e08ihx.5sc6y6-2.usa-e2.cloudhub.io/oauth2/token HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: application/x-www-form-urlencoded

Content-Length: 133

Host: softchoice-authentication-e08ihx.5sc6y6-2.usa-e2.cloudhub.io

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.5.5 (Java/16.0.2)

client_id=0cc4d4e6-7d18-4438-88e1-db09fad5495a

&grant_type=client_credentials

&client_secret=8-X8Q~MxmVr8MS50StSX9a~4JhIhDSrpV7jULbgY

Sample Token Response

{

"token_type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WNhNzMxMjFlOTAiXSwieG1zX2lkcmVsIjoiMjYgMTMiLCJ4bXNfdGNkdCI6MTM0MjUzODYzOX0.d-FIqoopykahokxadv6Hq2aNgr2xuTw5A9varjBpd-vjVyJoxov5K55CRIhhwdgYwTdp7dKg9yuOZT_dFZwjaqSguq5WfEa2RbjwLKDPopZf4PuOUHC5_KZq1XwA4cQyG2j-l2r8Wq3gcncGj3n_Z4RyZirKvdYjEf8wVPM3asZzwdBQofn83LZUX41_pK5lTxW6VX-S1l--akxrdv4p-nEWtSEhblHInyBcrtApfo0cxVABh6mXDCSOnn053NGOgNgljaWPBfjwpM0IDUXIPK24fsfyai-7P8Irr-wOzJHxNXz_TkS_SGB4t9uLgclFA5VJbK1K0M2OuSELSnqTaQ"

}

Sample API Request with OAuth2 Authentication

curl "https://softchoice-authentication-e08ihx.5sc6y6-2.usa-e2.cloudhub.io/oauth2/token" \ -X POST \ -d "client_id: 0cc4d4e6-7d18-4438-88e1-db09fad5495a\nclient_secret: 8-X8Q~MxmVr8MS50StSX9a~4JhIhDSrpV7jULbgY\ngrant_type: client_credentials" \ -H "Content-Type: x-www-form-urlencoded"

How to Start Using

To start using our REST APIs follow the simple steps below:

  1. Sign up/Log in: Ensure you have access to log in to the Softchoice Developer portal using your My Softchoice username and password. The portal is your central hub for accessing API documentation, generating API keys and testing endpoints. Please reach out to your Softchoice account manager if you don’t have access to the Developer Portal.
  2. Review API Documentation: Browse the API documentation to review usage instructions for all available APIs or cXML located on the tabs on top of your dashboard
  3. Understand Authentication: Our APIs use token-based authentication for secure access. Please visit the ”Softchoice OAuth2 Authentication” section, which provides a detailed overview of token-based authentication.
  4. Test the API: The APIs can be tested using the mocking service available on the Developer Portal. If non-production endpoints are required for end-to-end testing, please contact our teams for details.
  5. Request the access to the API: Click on the API you want to integrate on the portal. Click on the access request on the home page of the API. Follow the instruction to create a client application and generate the credentials required for calling the APIs.
  6. Build and deploy: After testing, implement the endpoints in your system using your preferred programming language or integration platform.

Environments and Endpoints

Environments

The Softchoice integration framework is maintained across various environments. You can integrate with the following:

  • Mocking Service Although the mocking service does not operate in a true runtime environment, it is a useful tool for exploring and familiarizing yourself with the API.

  • Production Environment The production environment is the target implementation of integration onboarding processes, where the integration is hosted and executed.

  • Non-production Environment Non-production environments are used for testing. They replicate the infrastructure and functionality of the production environment. However, the data in non-production environments may differ from the production version with all sensitive data removed or masked. If you need to perform testing in non-production environments, please contact our support team.

Endpoints
Service nameProduction endpointsNon-production endpoints
Access tokenSame as production
Rest order API
Order CXMLhttps://api.softchoice.com:9900/b2b/cxmlhttps://qaapi.softchoice.com:9900/b2b/cxml
EDIhttps://api.softchoice.com:9900/b2b/edihttps://qaapi.softchoice.com:9900/b2b/edi
Product catalogtbd.tbd.