Skip to content

REST API POST error

I’m trying to post:

{
"product": {
    "sku": "a",
    "view_code": "english",
    "product_type": "simple",
    "attribute_set_id": "4",
    "price": 25,
    "status": 1,
    "visibility": 1,
    "extension_attributes": {
        "category_links": [
            {
                "position": 0,
                "category_id": "11"
            },
            {
                "position": 1,
                "category_id": "12"
            },
            {
                "position": 2,
                "category_id": "16"
            }
        ],
        "stock_item": {
            "qty": "10",
            "is_in_stock": true
        }
    },
    "custom_attributes": [
        {
            "attribute_code": "short_description",
            "value": "xy"
        }
    ]
},
"product": {
    "sku": "Nd",
    "view_code": "english",
    "product_type": "simple",
    "attribute_set_id": "4",
    "price": 25,
    "status": 1,
    "visibility": 1,
    "extension_attributes": {
        "category_links": [
            {
                "position": 0,
                "category_id": "11"
            },
            {
                "position": 1,
                "category_id": "12"
            },
            {
                "position": 2,
                "category_id": "16"
            }
        ],
        "stock_item": {
            "qty": "10",
            "is_in_stock": true
        }
    },
    "custom_attributes": [
        {
            "attribute_code": "sa"
        }
    ]
},
"product": {
    "sku": "N1asa003",
    "view_code": "english",
    "product_type": "simple",
    "attribute_set_id": "4",
    "price": 25,
    "status": 1,
    "visibility": 1,
    "extension_attributes": {
        "category_links": [
            {
                "position": 0,
                "category_id": "11"
            },
            {
                "position": 1,
                "category_id": "12"
            },
            {
                "position": 2,
                "category_id": "16"
            }
        ],
        "stock_item": {
            "qty": "10",
            "is_in_stock": true
        }
    },
    "custom_attributes": [
        {
            "attribute_code": "short_description",
            "value": "asdasd"
        }
    ]
},
"product": {
    "sku": "N1s4",
    "view_code": "english",
    "product_type": "simple",
    "attribute_set_id": "4",
    "price": 25,
    "status": 1,
    "visibility": 1,
    "extension_attributes": {
        "category_links": [
            {
                "position": 0,
                "category_id": "11"
            },
            {
                "position": 1,
                "category_id": "12"
            },
            {
                "position": 2,
                "category_id": "16"
            }
        ],
        "stock_item": {
            "qty": "10",
            "is_in_stock": true
        }
    },
    "custom_attributes": [
        {
            "attribute_code": "short_description",
            "value": "dfffd<sdf<"
        }
    ]
}}

With this url:

/index.php/rest/english/V1/products

I’m getting response 500

Thanks!
Wayx