This section is the extension of Discount section, it give's control over user discounts.
To be active discount it must be attached to specific user - and then it will get applied at checkout.
Admin logged in - can attach any discount to any user, or remove any discount attachment from any user.
User logged in - an see it's attached discount's in case he has any,at trade checkout.
update exact row from user_discounts DB table using user_discount_id
raw(json)
Success
Unauthorized
Forbidden
{- "user_id": "Y0ZuTVFCNnl6S3pISDhMTXVYSHBwZz09",
- "discount_id": "WlBPdmtSY2hITGM9",
- "expiry_date": "2023-10-26 08:53:53"
}
{- "api_message": "<string>",
- "api_data": null
}
getting discounts rows of user if user does not exist or he does not have discount defined , empty array is return in api_data
Success
Unauthorized
Forbidden
{- "api_message": "<string>",
- "api_data": { },
- "id": "<string>",
- "user_id": "<string>",
- "discount_id": "<string>",
- "status": true,
- "is_gross": true,
- "expiry_date": "<datetime string>",
- "created_at": "<datetime string>",
- "updated_at": "<datetime string>",
- "is_one_time": true,
- "currency": "<string>",
- "volumes": {
- "discount": [
- {
- "volume": 1,
- "type": "<string>",
- "amount": 1
}
]
}
}
Attach a discount to a specified user.
Success
Unauthorized
Forbidden
Unprocessable Content
Internal Server Error
{- "user_id": "Y0ZuTVFCNnl6S3pISDhMTXVYSHBwZz09",
- "discount_id": "WlBPdmtSY2hITGM9",
- "expiry_date": "2023-10-26 08:53:53"
}
{- "api_message": "<string>",
- "api_data": null
}