Creating redemptions
Once you have setup an account and authenticated, and created a promotion you can then proceed to create redemptions.
What is a redemption?
A redemption is an instance of a code, reward, points, or other entity tied to a recipient.
A redemption is usually delivered to a recipient either by email or SMS, but can also be saved virtually to be used later on via the API at your own leisure.
Redemption types
The type of redemption created depends on the promotion type configured for the promotion. Value Mapper supports several promotion types:
Discount-based redemptions
- DISCOUNT_FIXED - A fixed monetary discount (e.g., $10 off)
- DISCOUNT_PERCENTAGE - A percentage-based discount (e.g., 15% off)
These generate unique discount codes that can be applied at checkout.
Credit-based redemptions
- CREDIT_LOCAL_CURRENCY - Store credit in the connected service's currency
- CREDIT_GLOBAL_CURRENCY - Store credit that works across multiple currencies/regions
Credit redemptions are typically added to a customer's wallet and can be used across multiple purchases.
Product and shipping redemptions
- FREE_PRODUCT - Entitles the recipient to a free product
- FREE_SHIPPING - Provides free shipping on an order
- DISCOUNTED_SHIPPING_FIXED - A fixed discount on shipping costs
- DISCOUNTED_SHIPPING_PERCENTAGE - A percentage discount on shipping costs
Delivery methods
Redemptions can be delivered to recipients in different ways depending on the connected service:
- EMAIL - Sends the redemption code/reward via email
- PHONE - Sends the redemption via SMS
- LINK - Generates a redemption link (primarily for Tremendous rewards)
For Shopify-connected promotions, codes are automatically synced to the Shopify store. For Tremendous-connected promotions, rewards are created and delivered through the Tremendous platform.
Creating a redemption
Creating a redemption can be done via the GraphQL API:
mutation CreateRedemption($redemption: CreateRedemptionInput!) {
createRedemption(redemption: $redemption) {
success
redemptionCodes {
uuid
code
externalId
deliveryContent
deliveryMethod
recipientExternalId
}
errors {
field
message
}
}
}
Input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
promotionUuid | String | Yes | The UUID of the promotion to create the redemption for |
codes | [String] | No | Specific codes to use (if not provided, codes are auto-generated) |
recipientEmail | String | No | Email address of the recipient |
recipientName | String | No | Name of the recipient |
recipientPhone | String | No | Phone number of the recipient |
deliveryMethod | DeliveryMethodInput | No | How to deliver the redemption (EMAIL, PHONE, or LINK) |
recipientCustomerId | String | No | External customer ID for the recipient |
inviteToken | String | No | Token used for identity linking with Shopify |
Example: Creating a redemption with recipient details
mutation {
createRedemption(redemption: {
promotionUuid: "abc123-def456-ghi789"
recipientEmail: "customer@example.com"
recipientName: "John Doe"
deliveryMethod: EMAIL
}) {
success
redemptionCodes {
uuid
code
}
errors {
message
}
}
}
Example: Creating a redemption with a specific code
mutation {
createRedemption(redemption: {
promotionUuid: "abc123-def456-ghi789"
codes: ["WELCOME20"]
recipientEmail: "customer@example.com"
}) {
success
redemptionCodes {
code
}
}
}
Generating codes in bulk
For Shopify-connected promotions, you can generate multiple redemption codes at once without assigning them to specific recipients. This is useful for pre-generating codes for marketing campaigns or physical distribution.
mutation GenerateRedemptionCodes($promotionUuid: String!, $count: Int!) {
generateRedemptionCodes(promotionUuid: $promotionUuid, count: $count) {
success
redemptionCodes {
uuid
code
}
errors {
field
message
}
}
}
Example: Generating 100 codes
mutation {
generateRedemptionCodes(promotionUuid: "abc123-def456-ghi789", count: 100) {
success
redemptionCodes {
code
}
}
}
Bulk code generation is processed in batches of 100 codes for Shopify-connected promotions. The codes are automatically synced to your Shopify store's discount system.