Skip to main content

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

ParameterTypeRequiredDescription
promotionUuidStringYesThe UUID of the promotion to create the redemption for
codes[String]NoSpecific codes to use (if not provided, codes are auto-generated)
recipientEmailStringNoEmail address of the recipient
recipientNameStringNoName of the recipient
recipientPhoneStringNoPhone number of the recipient
deliveryMethodDeliveryMethodInputNoHow to deliver the redemption (EMAIL, PHONE, or LINK)
recipientCustomerIdStringNoExternal customer ID for the recipient
inviteTokenStringNoToken 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
}
}
}
note

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.