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