1. Help Center Home
  2. API
  3. Using the API
  4. POST GenerateCustomerSession Request

POST GenerateCustomerSession Request

Overview

This endpoint allows you to generate a Session, which can then be used to return Customer-specific pricing in a customer_price property.

Setup

To use this endpoint, your Authorization must have the following settings:

  • Authorization Type: Default
  • Session Access Type: Any value other than “None”

Request Information

HTTP Method: POST

Endpoint: https://api.cimcloud.com/{sitename}/GenerateCustomerSession/

Body:

{ 
"username": "xxxxxxxxxxxxxxxxxxxxxxxxx"
}

Successful Response:

{ 
"expiration": "XXXX-XX-XXXXX:XX:XX", 
"token": "xxxxxxxxxxxxxxxxxxxxxxxxx", 
"session": "xxxxxxxxxxxxxxxxxxxxxxxxx" 
}

Note: A new token in the response will be generated with the session attached.  Use this new token to GET customer-specific pricing.

Testing Steps

  1. Setup your Authorization to return session-based pricing
    1. On the Authorization add-edit page in the Worker Portal, verify the following fields are set:
      1. Authorization Type: Default
      2. Session Access Type: Any Session
  2. Generate Authentication Token (more info)
  3. Run a GET on a product that contains a pricing override
    1. GET: https://api.cimcloud.com/{sitename}/products/searchexact~sku~{sku}
  4. Generate a Session for a username using the POST request in this article
    1. POST: https://api.cimcloud.com/{sitename}/GenerateCustomerSession/
  5. Using the new Token that was generated from step 5, run the same request from step 3
    1. Customer-specific pricing will be in the “customer_price” property
  6. Login to the site as the user in step 4 and confirm the prices match

Was this article helpful

Related Articles

Subscribe to receive email updates of what's new in the CIMcloud Help Center.