Create a voucher

Create a voucher and attribute it to a specific membership.

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Path parameters

pidstringRequiredformat: "uuid"
Loyalty Program ID

Request

This endpoint expects an object.
rewardIdstringRequiredformat: "uuid"
Reward id
codestringOptional<=128 characters
Code generated to attribute reward to a contact
contactIdlongOptional>=1
Contact to attribute the reward
expirationDatestringOptional
Reward expiration date
loyaltySubscriptionIdstringOptional
One of contactId or loyaltySubscriptionId is required
metamap from strings to anyOptional

Offer meta information (key/value object)

valuedoubleOptional0.01-99999999.99
Value of the selected reward config
validFromstringOptional

Date from which the voucher becomes valid. Accepts RFC 3339 or DD/MM/YYYY HH:MM AM/PM format. Converted to UTC using the organization’s timezone.

Response

Voucher successfully created
codestringOptional
Generated code
consumedAtstringOptional
Timestamp for when this reward was consumed
contactIdlongOptional
Id of the contact that attributed the reward
createdAtdatetimeOptional
Timestamp for when this reward was created
expirationDatedatetimeOptional
Expiration date of the reward
idstringOptionalformat: "uuid"
Unique identifier
loyaltyProgramIdstringOptional
Loyalty Program Id to which attributed reward belongs
metamap from strings to anyOptional
Additional data to define the reward
rewardIdstringOptional
Unique identifier for the reward
updatedAtdatetimeOptional
Timestamp for when this reward was updated
valuedoubleOptional
Value of the selected reward config
validFromdatetimeOptional
Date from which the voucher becomes valid

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error