/1/purchase - POST

Overview

This API generates a purchase for the learner and assigns it to the learner that enables an active subscription for it and take assessments


Headers

Key

value

Description

X-LearnerId (Required)

<LearnerId value>

The learner for which you want to create the authorization for

X-UserId Optional

<UserId Value>

The UserId to which learner belongs. If left empty it will authorize the learner with Bearer token

Body

Key

Value

Description

systemDomain

vbmapp

System Domain can be added as vbmapp

productType

Assessment


locale

e.g en,es etc

The locale of the assessment that we want to set the subscription for

Code Example

curl --location 'https://api-sandbox.vbmappapp.com/1/purchase' \
--header 'User-Agent: dmtd-rest-api' \
--header 'Accept: application/json' \
--header 'X-LearnerId: 19354' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 8KctZgX39gHAZOU7M0ENvQ==' \
--data '{ "systemDomain": "vbmapp", "productType": "assessment", "locale": "en" }'

Example Response

[
    {
        "quantity": 1,
        "subscriptionLength": {
            "type": "years",
            "length": 1
        },
        "id": 1044,
        "purchasedProductsGenerated": true,
        "organizationId": 259,
        "createdAt": "2025-06-09T09:16:24.000000Z",
        "updatedAt": "2025-06-09T09:16:24.000000Z",
        "completed": true,
        "productDescription": {
            "productType": "assessment",
            "assessmentProduct": {
                "locale": "en",
                "systemDomain": "vbmapp"
            }
        }
    }
]