POST /product_drafts/create

POST /product_drafts/create

Create product draft

Body Required

  • product_attributes object Required
    Hide product_attributes attributes Show product_attributes attributes object
    • brand_id integer Required
    • category_id integer Required
    • title string Required
    • image string
    • raw_label string Required
    • asin string

Responses

  • 201

    successful operation

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • id integer(int32)
      • author_user_id integer(int32)
      • reviewer_user_id integer(nullable)
      • product_attributes object
        Hide product_attributes attributes Show product_attributes attributes object
        • image string
        • title string
        • brand_id integer(int32)
        • raw_label string
        • category_id integer
      • ingredient_classifications array[object]
        Hide ingredient_classifications attributes Show ingredient_classifications attributes array[object]
        • label_text string
        • label_order integer(int32)
        • normalized_label string
        • recognized_ingredients array[object]
          Hide recognized_ingredients attributes Show recognized_ingredients attributes array[object]
          • id integer(int32)
          • title string
        • classified_ingredient_id integer(int32)
      • draft_version integer(int32)
      • created_at string(DateTime)
      • updated_at string(DateTime)
      • approved_at string(nullable)
      • approved_product_id integer(int32)
  • 401

    Authorization information is missing or invalid.

  • 400

    Bad Request

  • 422

    Unprocessable Entity

  • 500

    Server Error

POST /product_drafts/create
curl \
 -X POST https://api.cosmily.com/api/v1/product_drafts/create \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"product_attributes":{"brand_id":42,"category_id":42,"title":"string","image":"string","raw_label":"string","asin":"string"}}'
Request example
{
  "product_attributes": {
    "brand_id": 42,
    "category_id": 42,
    "title": "string",
    "image": "string",
    "raw_label": "string",
    "asin": "string"
  }
}
Request examples
{
  "product_attributes": {
    "brand_id": 42,
    "category_id": 42,
    "title": "string",
    "image": "string",
    "raw_label": "string",
    "asin": "string"
  }
}
Response examples (201)
{
  "data": {
    "id": 42,
    "author_user_id": 42,
    "reviewer_user_id": 42,
    "product_attributes": {
      "image": "string",
      "title": "string",
      "brand_id": 42,
      "raw_label": "string",
      "category_id": 42
    },
    "ingredient_classifications": [
      {
        "label_text": "string",
        "label_order": 42,
        "normalized_label": "string",
        "recognized_ingredients": [
          {
            "id": 42,
            "title": "string"
          }
        ],
        "classified_ingredient_id": 42
      }
    ],
    "draft_version": 42,
    "created_at": "string",
    "updated_at": "string",
    "approved_at": "string",
    "approved_product_id": 42
  }
}
Response examples (201)
{
  "data": {
    "id": 42,
    "author_user_id": 42,
    "reviewer_user_id": 42,
    "product_attributes": {
      "image": "string",
      "title": "string",
      "brand_id": 42,
      "raw_label": "string",
      "category_id": 42
    },
    "ingredient_classifications": [
      {
        "label_text": "string",
        "label_order": 42,
        "normalized_label": "string",
        "recognized_ingredients": [
          {
            "id": 42,
            "title": "string"
          }
        ],
        "classified_ingredient_id": 42
      }
    ],
    "draft_version": 42,
    "created_at": "string",
    "updated_at": "string",
    "approved_at": "string",
    "approved_product_id": 42
  }
}