POST
/merchant-vouchers
Create a merchant voucher
Merchants
Description
Create a merchant voucher.
Authentication Required: User must be authenticated and have the 'merchant' feature flag.
Authorization: Merchant users can only create vouchers for their own merchant account. The target merchant is provided in the request body.
Request Body
requiredapplication/json
Responses
201
Merchant voucher created successfully
application/jsonstatusstring
Example:
successmessagestring
Example:
Merchant voucher created successfullydataobject
Example:
{
"status": "success",
"message": "Merchant voucher created successfully",
"data": {
"id": 1,
"merchant_id": 1,
"code": "GLOBAL15",
"valid_from": "2026-05-01",
"valid_until": "2026-12-31",
"usage_conditions": "15% off orders above 100 EUR. Cannot be combined with other offers.",
"created_at": "2026-05-20T10:00:00Z",
"updated_at": "2026-05-20T10:00:00Z"
}
}
401
Authentication required
application/jsonExample:
{
"status": "error",
"message": "Not authenticated or insufficient permissions"
}
404
Merchant not found
application/jsonExample:
{
"status": "error",
"message": "Merchant not found"
}
422
Validation error
application/jsonExample:
{
"status": "error",
"message": "Failed to create merchant voucher",
"errors": [
{
"path": "code",
"message": "can't be blank"
}
]
}