Open carlosmota-bloop opened 1 month ago
Thank you for reporting this issue. Our findings indicate that the error is on our side, as passing the type: DISCOUNT_VOUCHER should be possible and acceptable in the case of a referral campaign. We have already prepared a fix for this bug. The issue will be resolved next week. An SDK update will not be necessary. We apologize for the inconvenience.
I'm trying to create a new referral code voucher in a referral campaign.
I experimented with the API docs and managed to do it via this endpoint (https://docs.voucherify.io/reference/generate-random-code)
Request:
POST https://api.voucherify.io/v1/vouchers
Body:
This creates a referral code with a code that follows the code config of the campaign, as expected.
I'm trying to achieve the same result using the .net SDK with this code:
But the response is:
VoucherifyError[code=400, key='invalid_voucher, message='Invalid Voucher', details='Voucher type does not match provided campaign type']
.By checking the audit logs, it seems that the generated request includes the voucher type is set as DISCOUNT_VOUCHER. This is the request body
My understanding is that the voucher type should be an optional parameter, but it isn't nullable in the VoucherCreate class in the SDK.
Is this a bug or should I use another method to achieve this?