Detailed Pricing API overview
Mass import of pricing
This document will cover how to perform the pricing import function by leveraging a newly created LTO Pricing API.
Authentication and Authorization
The LTO REST API uses HTTP verbs and a RESTful endpoint structure
Information used for API authentication and authorization is submitted in the request header. The following header name/values are required with each request.
Header | Description |
CompanyLoginId | Company Login Id (provisioned by LTO account management) |
ProductId | Product Id. 1=Learning Management, 2=Event Management |
Username | User account username |
Password | User account password |
Request and response payloads
The LTO REST API request and response payloads are formatted as JSON. The API uses a combination of a HTTP status code and JSON message in the body of the response to report the status of each operation or request. The HTTP status code will convey the status of the operation and the JSON message will contain additional information, which will vary depending on the operation.
Property | Type | Required | Max | Description |
Success | Boolean | Y | Was the operation successful (true/false) | |
Error | Array of Error objects | If Success=false, error object is included. Otherwise Error is set to null | ||
Data | Object or array of objects | If Success=false, Data is set to null |
The error object contains the following properties:
Property | Type | Required | Max | Description |
Code | string | Y | System error code returned from the operation. See system error code reference | |
Message | string | Y | System message corresponding to the system error code. See system error code reference | |
MessageDetail | string | N | Additional details concerning error |
LTO REST API Reference – Pricing
Pricing
Operation | Create pricing | ||||||
Description | Create brand new price records for new courses | ||||||
Method | POST | ||||||
Request | Provide pricing object in request body | ||||||
Response |
|
Operation | Add new currency/country/pricing for existing pricing records | ||||||
Description | Add new currency/country/pricing for existing pricing records. This supports only numeric prices | ||||||
Method | POST | ||||||
Request | Provide pricing object in request body. | ||||||
Response |
|
Operation | Update pricing (complete pricing object update) | ||||||||
Description | Update pricing of existing pricing records. This operation supports complete object update only. Partial object update is NOT supported at this time. If the API request data does not supply ALL properties/fields with their intended values, the fields not supplied will be assigned the default value: NULL. If the record previously had data in this field, the value will now be set to NULL. The PricingID and RowID are required for update. If the RowID does not exist then an error will be thrown. | ||||||||
Method | PUT | ||||||||
Request | Provide updated pricing object in request body. | ||||||||
Response |
|
Operation | Update Country Pricing (partial pricing object update) | ||||||||
Description | Update country/currency/price for existing pricing records. This operation supports partial object update only. The PricingID, RowID, Country, Currency, Price and DefaultPrice are required for the update. If the RowID does not exist then an error will be thrown. This supports only numeric prices. | ||||||||
Method | PUT | ||||||||
Request | Provide updated pricing object in request body. | ||||||||
Response |
|
Pricing object
Property | Type | Required | Max | Description/Notes |
ID | int | N/A | Read-only. Resource Identifier (system generated) | |
RowID | Int | N/A | Only used in response and in API URL | |
PricingID | Int | N/A | Only used in response and in API URL | |
CourseID | Int | N/A | Only used in response and in API URL | |
PriceName | string | Y | 255 | Course Price Name |
Description | String | N | 255 | Course Price Description |
Price | numeric | Y | 9,2 | Course Price |
OtherPrice | String | N | 255 | Other price value besides adding country and currency information |
IsListPrice | Int | N | If price is a list Price. Values are 1 or 0 | |
PriceType | string | N/A | 50 | If price is added for country and currency then the value is “numeric” else “alphanumeric. Only used in response |
CurrencyCode | string | Y | 3 | Currency code for price |
DefaultPrice | Int | Y | Used to determine the default currency. Values are 1 or 0. This is not required when “Adding new country currency” to existing price record” | |
StartDate | Datetime | N | Price start date | |
ExpirationDate | Datetime | N | Price expiration date | |
AlwaysDisplay | Smallint | N | Always Display Price (regardless of Start/Expiration dates). Values are 1 or 0 | |
DisplayToAll | Smallint | N | Display Group Pricing to All. Values are 1 or 0 | |
IgnoreDiscountUplift | Smallint | N | Ignore Attendee Group-Assigned Discount. Values are 1 or 0 | |
DisplayOnly | Smallint | N | If list price is display only. Values are 1 or 0 | |
DisplayMultiCurrencies | Smallint | N | Display all currencies. Values are 1 or 0 | |
CurrencyCountry | String | N | 2 | Currency Country Code |
GroupID | Int | N | Attendee Group key |
Course Pricing Endpoint URLs
- Get course pricing data by Course ID.
End point URL: GET/Price/Course/5
Example: https://apibeta.viewcentral.com/api/course/30/price
{ "Success": true, "Error": null, "Data": { "CourseId": 30, "PriceRecord": [ { "RowId": 391, "PricingId": 265, "PriceName": "Bundle Price", "Description": "Descr", "IsListPrice": 0, "AlwaysDisplay": 0, "DisplayToAll": 1, "IgnoreDiscountUplift": 0, "DisplayOnly": 0, "DisplayMultiCurrencies": 1, "StartDate": "2014-01-01T16:00:00.000", "ExpirationDate": "2015-03-05T16:00:00.000", "OtherPrice": "alpha price", "PriceType": "AlphaNumeric", "CountryCurrency": [ { "CurrencyCountry": "", "CurrencyCode": "USD", "Price": "", "DefaultPrice": 0, "ID": 227838 } ], "AttendeeGroups": [ { "GroupID": 5, "GroupName": "Former TdF Winners" }, { "GroupID": 6, "GroupName": "TdF Favorite" }, { "GroupID": 7, "GroupName": "One hit TdF wonders" } ] }, { "RowId": 392, "PricingId": 265, "PriceName": "Bundle Price updated", "Description": "Descr", "IsListPrice": 0, "AlwaysDisplay": 0, "DisplayToAll": 1, "IgnoreDiscountUplift": 0, "DisplayOnly": 0, "DisplayMultiCurrencies": 1, "StartDate": "2014-01-01T16:00:00.000", "ExpirationDate": "2015-03-05T16:00:00.000", "OtherPrice": "", "PriceType": "Numeric", "CountryCurrency": [ { "CurrencyCountry": "US", "CurrencyCode": "USD", "Price": "120.00", "DefaultPrice": 1, "ID": 227842 } ], "AttendeeGroups": [ { "GroupID": 5, "GroupName": "Former TdF Winners" }, { "GroupID": 6, "GroupName": "TdF Favorite" }, { "GroupID": 7, "GroupName": "One hit TdF wonders" } ] }, { "RowId": 393, "PricingId": 265, "PriceName": "Bundle Price 3 updated", "Description": "Descr", "IsListPrice": 0, "AlwaysDisplay": 0, "DisplayToAll": 1, "IgnoreDiscountUplift": 0, "DisplayOnly": 0, "DisplayMultiCurrencies": 1, "StartDate": "2014-01-01T16:00:00.000", "ExpirationDate": "2015-03-05T16:00:00.000", "OtherPrice": "", "PriceType": "Numeric", "CountryCurrency": [ { "CurrencyCountry": "GB", "CurrencyCode": "GBP", "Price": "1200.00", "DefaultPrice": 0, "ID": 227846 }, { "CurrencyCountry": "UZ", "CurrencyCode": "NZD", "Price": "1000.00", "DefaultPrice": 1, "ID": 227847 } ], "AttendeeGroups": [ { "GroupID": 5, "GroupName": "Former TdF Winners" }, { "GroupID": 6, "GroupName": "TdF Favorite" }, { "GroupID": 7, "GroupName": "One hit TdF wonders" } ] } ] } }
- Create completely new pricing data for existing courses i.e. add one or more new prices. If the price records are successfully created then a “Get course pricing data by Course ID” will be provided in the response.
End point URL: POST /Course/<CourseID>/Price
Example: https://apibeta.viewcentral.com/api/course/6/Price
{ "PriceRecord": [ { "PriceName": "Bundle Price", "Description": "Descr", "IsListPrice": 0, "AlwaysDisplay": 0, "DisplayToAll": 1, "IgnoreDiscountUplift": 0, "DisplayOnly": 0, "DisplayMultiCurrencies": 1, "StartDate": "2014-01-01", "ExpirationDate": "2015-03-05", "OtherPrice": "", "CountryCurrency": [ { "CurrencyCountry": "GB", "CurrencyCode": "GBP", "Price": "1200.00", "DefaultPrice": 0 }, { "CurrencyCountry": "UZ", "CurrencyCode": "NZD", "Price": "1000.00", "DefaultPrice": 1 } ], "AttendeeGroups": [ { "GroupID": 5 }, { "GroupID": 6 }, { "GroupID": 7 } ] }, { "PriceName": "Bundle price 2", "Description": "Descr", "IsListPrice": 1, "AlwaysDisplay": 0, "DisplayToAll": 0, "IgnoreDiscountUplift": 0, "DisplayOnly": 0, "DisplayMultiCurrencies": 0, "StartDate": "", "ExpirationDate": "", "OtherPrice": "Free Sampler" } ] }
- Add a new country/currency/price for an existing price record (pricing ID and row ID). The default price cannot be set here and by default it will be set to 0 for new country/currency/price records. If the new country/currency/price records are successfully created then a “Get course pricing data by Course ID” will be provided in the response.
End point URL: – POST /Course/<CourseID>/Price/Row/<rowID>
https://apibeta.viewcentral.com/api/course/6/Price/Row/394
Example
{ "PriceRecord": [ { "CountryCurrency": [ { "Price": "50.00", "CurrencyCode": "USD", "CurrencyCountry": "US" }, { "Price": "20.00", "CurrencyCode": "CAD", "CurrencyCountry": "CA" } ] } ] }
- Update: Update complete pricing object. Existing pricing data will be overwritten with the data sent through this API so the complete pricing data has to be sent in the request. If the update is successful then a “Get course pricing data by Course ID” will be provided in the response.
End point URL: PUT /Courses/<CourseID>/Price/Row/<rowID>
https://apibeta.viewcentral.com/api/course/30/Price/Row/393
– Update to PricingObject.PriceType =”Numeric”
{ "PriceRecord": [ { "PriceName": "API Price updated", "Description": "Descr", "IsListPrice": 0, "AlwaysDisplay": 0, "DisplayToAll": 0, "IgnoreDiscountUplift": 0, "DisplayOnly": 0, "DisplayMultiCurrencies": 0, "StartDate": "2014-01-01", "ExpirationDate": "2015-03-05", "CountryCurrency": [ { "CurrencyCountry": "GB", "CurrencyCode": "EUR", "Price": "1200.00", "DefaultPrice": 1 }, { "CurrencyCountry": "US", "CurrencyCode": "USD", "Price": "1000.00", "DefaultPrice": 0 } ], "AttendeeGroups": [ { "GroupID": 5 }, { "GroupID": 6 }, { "GroupID": 7 } ] } ] }
– Update to PricingObject.PriceType =”Alphanumeric”
https://apibeta.viewcentral.com/api/course/30/Price/Row/391
{ "PriceRecord": [ { "PriceName": "API Price updated", "Description": "Descr", "IsListPrice": 0, "AlwaysDisplay": 0, "DisplayToAll": 0, "IgnoreDiscountUplift": 0, "DisplayOnly": 0, "DisplayMultiCurrencies": 0, "StartDate": "2014-01-01", "ExpirationDate": "2015-03-05", "Otherprice": "Free Sampler", "AttendeeGroups": [ { "GroupID": 5 }, { "GroupID": 6 }, { "GroupID": 7 } ] } ] }
- Update: partial pricing object i.e. country/currency/pricing – this is created so it can support update through import functionality as well as outside of the UI. If the update is successful then a “Get course pricing data by Course ID” will be provided in the response.
End point URL: PUT /Courses/<CourseID>/Country/Price/Row/<rowID>
https://apibeta.viewcentral.com/api/course/6/Country/Price/Row/394
Example
{ "PriceRecord": [ { "CountryCurrency": [ { "Price": "20.00", "CurrencyCode": "USD", "CurrencyCountry": "US", "Defaultprice": 1 }, { "Price": "30.00", "CurrencyCode": "FRF", "CurrencyCountry": "FR", "Defaultprice": 0 } ] } ] }
For a complete list of error codes, please review the section “LTO REST API Reference – System Error Codes”, which is available toward the end of this document.
Response Examples
Below are examples to give a sense of how the responses are structured and formatted
Example 1: Incorrect authentication information is provided in any operation
GET pricing by Course ID
HTTP Status: 401
Response:
{ "Success": false, "Error": { "Code": "AUTHENTICATION_FAILED ", "Message": "Request authentication/Authorization failed", "MessageDetail": "Authentication failed. Incorrect company login ID, product ID, username or password provided." }, "Data": null }
Example 2: 3 errors found (incorrect data format, duplicate record and restriction record errors found) creating pricing object)
HTTP Status: 400
Response:
{ "Success": false, "Error": [ { "Code": "INVALID_DATA_FORMAT", "Message": "Value supplied is not in the acceptable data format", "MessageDetail": "Price should be numeric" }, { "Code": "INVALID_DATA_DUPLICATE", "Message": "Duplicate record found", "MessageDetail": "Cannot have duplicate value for country, currency code and pricing for same course" }, { "Code": "INVALID_DATA_REFERENCE_CODE", "Message": "Reference code supplied is invalid", "MessageDetail": "Currency Code should be only 3-characters" } ] }
LTO REST API Reference – System Error Codes
Note: the LTO API does not currently support localized error messages
Error Code | Error Message |
INVALID_REQUEST | Invalid Request |
AUTHENTICATION_FAILED | Request authentication/Authorization failed |
VALIDATION_FAILED | Request validation process failed |
INVALID_DATA_TYPE | Value supplied is not in the acceptable data type |
INVALID_DATA_FORMAT | Value supplied is not in the acceptable data format |
INVALID_DATA_RANGE | Value supplied is not in the acceptable range |
INVALID_DATA_LENGTH | Value supplied is not in the acceptable length |
INVALID_DATA_REFERENCE_CODE | Reference code supplied is invalid |
INVALID_DATA_REFERENCE_OBJECT | Reference object supplied is invalid |
INVALID_DATA_DUPLICATE | Duplicate record found |
REQUIRED_DATA_MISSING | Required data missing |