Skip to content

    Get started

    This section explains how to get your clientId and clientSecret and how to generate your access token. As a result, you will be able to send your first requests.

    Complexity: Low

    Contact customer support

    In order to get started with Unified Commerce services, please contact customer support. We will then send you the contract.

    Please make sure to mention the channel you want to use. The clientId and the clientSecret are channel specific. You can use various channels, of course. But you'd need specific clientId and clientSecret for each channel you are going to use.

    After the contract is signed, you will receive a welcome email with your channel-specific:

    • clientId
    • clientSecret

    Once you've received the welcome email, you are able to generate your access token to programmatically communicate with the chosen channel through Unified Commerce services.

    Generate access token

    In order to programmatically communicate with our service, you must generate your access token using your clientId and clientSecret.

    Unified Commerce services use an Identity Provider (IdP) to generate your personal access token.

    Generate access token

    curl -k -d "grant_type=client_credentials" \
            -H "Authorization: Basic Base64({your clientId}:{your clientSecret})" \
    https://login.microsoftonline.com/2b8c81c1-69c3-4fcd-9de2-4579ced9d137/oauth2/v2.0/token

    The response will contain your access token and it's expiration time. In the example below, the expiration time is 3599 seconds (almost an hour).

    Generate access token response

    {
    "token_type": "Bearer",
    "expires_in": 3599,
    "ext_expires_in": 3599,

    The access token is only valid for a certain time. After that, it expires and must be renewed.

    Below are grant_type and scope details required to generate the access token for unified API.

    Sandbox:

    grant_type: client_credentials

    scope: https://unifiedcommercesandbox.onmicrosoft.com/unifiedapi/paymentservice/.default

    PRODUCTION:

    grant_type: client_credentials

    scope: https://unifiedcommerceprod.onmicrosoft.com/unifiedapi/paymentservice/.default

    🎉

    Now that you have your access token, you should be able to send your first requests.