{"prefix":"SALE20","name_template":"Giảm giá %d%% cho tất cả sản phẩm","description":"Đây là voucher áp dụng cho ngày 6-6, chỉ các sản phẩm này được áp dụng","instruction":"Giảm 10% tối đa 50.000đ","voucher_type":"product","discount_value":10,"discount_type":"percentage","min_order_value":300000,"max_discount_amount":100000,"start_date":"2025-05-01","end_date":"2026-07-31","quantity":10,"max_usage":1,"max_usage_per_customer":1,"is_for_all_products":true,"is_for_all_customers":true,"code_length":10,"use_letters":true,"use_numbers":true,"use_uppercase":true}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location--request POST 'http://petfen-voucher.local.com:8086/api/cms/v1/voucher/create' \
--header'X-Auth-Service: Bearer ' \
--header'Content-Type: application/json' \
--data-raw'{
"prefix": "SALE20",
"name_template": "Giảm giá %d%% cho tất cả sản phẩm",
"description": "Đây là voucher áp dụng cho ngày 6-6, chỉ các sản phẩm này được áp dụng",
"instruction": "Giảm 10% tối đa 50.000đ",
"voucher_type": "product",
"discount_value": 10,
"discount_type": "percentage",
"min_order_value": 300000,
"max_discount_amount": 100000,
"start_date": "2025-05-01",
"end_date": "2026-07-31",
"quantity": 10,
"max_usage": 1,
"max_usage_per_customer": 1,
"is_for_all_products": true,
"is_for_all_customers": true,
"code_length": 10,
"use_letters": true,
"use_numbers": true,
"use_uppercase": true
}'
Responses
🟢200Success
application/json
Body
Example
{"data":{"error":null,"failedCount":0,"totalCreated":2,"totalRequested":2},"message":"Vouchers created successfully","success":true}