/1/purchase - POST
Overview
Required Headers
Key | Value | Example |
---|---|---|
User-Agent | <company identifier> | The exact value here is not important, but it should include something to identify your company |
Accept | application/json | |
Authorization | Bearer <your token> | Bearer wV1MLk5+sFzioJw/3M5r9A== |
Content-Type | application/json | |
X-LearnerId | <the learner id> | The DMTD-supplied identifier that identifies the learner (see REST API Guide and /1/learner - POST) |
X-LearnerCode | <the learner code> | A REST-client-supplied identifier that identifies the learner (see REST API Guide and /1/learner - POST) |
Fields
Field | Type | Optional | Description |
---|---|---|---|
systemDomain | String | Required | The DMTD-Supported domain of the purchase ('vbmapp', 'efl') |
productType | String | Required | The type of product being purchased in the SystemDomain ('assessment', 'training') |
locale | String | Required | The locale (language) of the assessment ('en', 'es', 'fr') |
trainingProduct | String | Optional | Type type of training product being purchased ('conducting'). Required when type == 'training' |
Locale
Please note: The locale that is specified dictates the language the protocol and guide.
Example
Example
curl -X POST \
-H 'User-Agent: dmtd-rest-api' \
-H 'Authorization: Bearer L2Hth4lRwgHRBWtX8Hkl5w==' \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-LearnerId: 1" \
-d '{ "systemDomain": "vbmapp", "productType": "assessment", "locale": "en" }' \
https://api-sandbox.datamtd.com/1/purchase
Response
{ "quantity": 1, "subscriptionLength": { "type": "years", "length": 1 }, "id": 15, "purchasedProductsGenerated": true, "organizationId": 9, "updatedAt": "2019-07-16T14:06:54Z", "createdAt": "2019-07-16T14:06:54Z", "completed": true, "productDescription": { "systemDomain": "vbmapp", "productType": "assessment" } }