POST /v1/basket/add-product-to-basket

Adds a product to the user's basket

application/json

Body

Request to interact with products in the basket

  • basketId string Required

    ID of the basket to retrieve

  • product object Required
    Hide product attributes Show product attributes object
    • variantId string Required
    • quantity integer Required

Responses

  • 200 application/json

    The basket

    Hide response attribute Show response attribute object
    • basket object Required
      Hide basket attributes Show basket attributes object
      • id string Required
      • accountId string Required
      • enrolments array[object] Required
        Hide enrolments attributes Show enrolments attributes object
        • studentId string Required
        • courseId string Required
      • dropIns array[object] Required
        Hide dropIns attributes Show dropIns attributes object
        • studentId string Required
        • courseId string Required
        • date string(date) Required
        • time string Required
        • type string Required

          Values are trial or payg.

      • products array[object] Required
        Hide products attributes Show products attributes object
        • variantId string Required
        • quantity integer Required
POST /v1/basket/add-product-to-basket
curl \
 --request POST 'https://classmanager.test/v1/basket/add-product-to-basket' \
 --header "Content-Type: application/json" \
 --data '{"basketId":"bskt_xxx","product":{"variantId":"var_xxx","quantity":1}}'
Request examples
{
  "basketId": "bskt_xxx",
  "product": {
    "variantId": "var_xxx",
    "quantity": 1
  }
}
Response examples (200)
{
  "basket": {
    "id": "bskt_xxx",
    "accountId": "acct_xxx",
    "enrolments": [
      {
        "studentId": "stu_xxx",
        "courseId": "cls_xxx"
      }
    ],
    "dropIns": [
      {
        "studentId": "stu_xxx",
        "courseId": "cls_xxx",
        "date": "2025-01-01",
        "time": "09:30",
        "type": "trial"
      }
    ],
    "products": [
      {
        "variantId": "var_xxx",
        "quantity": 1
      }
    ]
  }
}