Magento 2 купон генерирует API-исключения

Мне трудно понять, почему V1 / купоны / генерирует {"message":"One or more input exceptions have occurred."} (status_code 400) error Я использую этот вызов для пакетной генерации 20 купонов:

curl -X POST path/index.php/rest/V1/coupons/generate \
-H "Authorization: Bearer TOKEN" \
-H "Content-type: application/json" -g \
-d '{
"couponSpec": {
"rule_id": 5,
"format": "string",
"quantity": 20,
"length": 0,
"prefix": "string",
"suffix": "string",
"delimiter_at_every": 0,
"delimiter": "string",
"extension_attributes": {}
}
}'

Если я сделаю запрос get на этот идентификатор правила продаж, я получу следующее возвращаемое:

curl -X GET path/index.php/rest/V1/salesRules/5 \
-H "Authorization: Bearer TOKEN" \
{
"rule_id": 5,
"name": "test",
"store_labels": [],
"description": "",
"website_ids": [
1
],
"customer_group_ids": [
0,
1,
2,
3
],
"from_date": "2019-02-05",
"to_date": "2019-02-06",
"uses_per_customer": 1,
"is_active": true,
"condition": {
"condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Combine",
"aggregator_type": "all",
"operator": null,
"value": true
},
"action_condition": {
"condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Product\\Combine",
"aggregator_type": "all",
"operator": null,
"value": true
},
"stop_rules_processing": false,
"is_advanced": true,
"sort_order": 0,
"simple_action": "by_percent",
"discount_amount": 0,
"discount_step": 0,
"apply_to_shipping": false,
"times_used": 0,
"is_rss": true,
"coupon_type": "SPECIFIC_COUPON",
"use_auto_generation": true,
"uses_per_coupon": 0,
"simple_free_shipping": "0"}

У меня нет ничего в моем файле exception.log — кто-нибудь сталкивался с этой конкретной проблемой и / или есть какие-то мысли о том, как устранить причину возникновения этой ошибки.

Я следил за документами здесь https://devdocs.magento.com/swagger/#resource_salesRuleCouponManagementV1 делать запросы

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector