POST /v1/shop/product/

Store or update a product

application/json

Body

Request body for creating a new product

  • id string
  • name string Required
  • categoryId string | null Required
  • taxRateId string
  • imgUrls array[object]
    Hide imgUrls attributes Show imgUrls attributes object
    • id string
    • upload string
    • operation string
    • url string
  • courses array[string]
  • variants array[object] Required
    Hide variants attributes Show variants attributes object
    • price integer Required
    • stock integer
    • code string
    • attributes array[object]
      Hide attributes attributes Show attributes attributes object
      • id string
      • name string Required
      • value string Required

Responses

  • 200 application/json

    A company product

    Hide response attributes Show response attributes object
    • id string Required
    • name string Required
    • taxRateId string
    • categoryId string | null Required
    • imgUrls array[object] Required
      Hide imgUrls attributes Show imgUrls attributes object
      • id string Required
      • url string Required
    • courses array[string] Required
    • variants array[object] Required
      Hide variants attributes Show variants attributes object
      • id string Required
      • price integer Required
      • stock integer | null Required
      • code string | null Required
      • attributes array[object] Required
        Hide attributes attributes Show attributes attributes object
        • id string Required
        • name string Required
        • value string Required
POST /v1/shop/product/
curl \
 --request POST 'https://api.classmanager.io/v1/shop/product/' \
 --header "Content-Type: application/json" \
 --data '{"id":"prod_01jr892g2ndffn7a62wa4nwv6n","name":"Ballroom Costumes","categoryId":"pcat_01jr892g2ndffn7a62wa4nwv6n","taxRateId":"tax_01jr892fdx8bjw166r1dm9c3hg","imgUrls":[{"id":"file_01jr892g2ndffn7a62wa4nwv6n","upload":"upload path","operation":"delete|retain","url":"https://example.com/image.png"}],"courses":["cls_01jr892g2ndffn7a62wa4nwv6n"],"variants":[{"price":5655,"stock":10,"code":"PUR-001","attributes":[{"id":"attr_01jqezwkq5es6ge03ag2qx17km","name":"Color","value":"Red"}]}]}'
Request examples
{
  "id": "prod_01jr892g2ndffn7a62wa4nwv6n",
  "name": "Ballroom Costumes",
  "categoryId": "pcat_01jr892g2ndffn7a62wa4nwv6n",
  "taxRateId": "tax_01jr892fdx8bjw166r1dm9c3hg",
  "imgUrls": [
    {
      "id": "file_01jr892g2ndffn7a62wa4nwv6n",
      "upload": "upload path",
      "operation": "delete|retain",
      "url": "https://example.com/image.png"
    }
  ],
  "courses": [
    "cls_01jr892g2ndffn7a62wa4nwv6n"
  ],
  "variants": [
    {
      "price": 5655,
      "stock": 10,
      "code": "PUR-001",
      "attributes": [
        {
          "id": "attr_01jqezwkq5es6ge03ag2qx17km",
          "name": "Color",
          "value": "Red"
        }
      ]
    }
  ]
}
Response examples (200)
{
  "id": "prod_01jq6nbd7b8hvajm12rbycwazt",
  "name": "Ballroom Costumes",
  "taxRateId": "tax_01jr892fdx8bjw166r1dm9c3hg",
  "categoryId": "pcat_01jr892g2ndffn7a62wa4nwv6n",
  "imgUrls": [
    {
      "id": "file_01jq6nbd7b8hvajm12rbycwazt",
      "url": "https://example.com/image.png"
    }
  ],
  "courses": [
    "cls_01jqezwkq5es6ge03ag2qx17km"
  ],
  "variants": [
    {
      "id": "var_01jqezwkq4s2qkep106djgbwjz",
      "price": 5655,
      "stock": 10,
      "code": "PUR-001",
      "attributes": [
        {
          "id": "attr_01jqezwkq5es6ge03ag2qx17km",
          "name": "Color",
          "value": "Red"
        }
      ]
    }
  ]
}