Create & Distribute Voucher Codes

Email Codes - Adding unique codes to email templates

Code API - Request codes to issue to consumers

How to create and download a CSV batch of unique codes

How create unique codes for emails

How to create a ‘click to reveal’ button

How to create embeddable codes

HTML Button - issuing unique codes on web pages

Offers API - Finding out about promotions

Merchant integration

JavaScript Integration Guide

API: Code Query API

API: Code Validation

API: Code Redemption

API Overview

Other

Create A CSV File In UTF-8 Format

User Redemption Query

Code Redemption Callback

Platform & Service Features

Reporting & Promotional Insights

Upload Your Own Personalised Codes

Create and edit a promotion

Vanity Codes

User Roles & Permissions Management

Mystery Discount

Canvas

Uniqodo Query Language (UQL) & Error Messaging

Content Gates

User Redemption Query

Updated by Frans

The User Redemption Query API can be used to perform a lookup on a given user identifier if it was supplied during redemption and retrieve the associated a summary of their discount and order total as well as the redemption history for that user on the given promotion.

End Point

[GET]  https://api.uniqodo.com/distributor/API_KEY/query/user-redemption/PROMOTION_UUID?userId=USER_IDENTIFIER

Example API Call

[GET]  https://api.uniqodo.com/distributor/64a287ae534cf1bd58f45f3e23de9d433caec669/query/user-redemption/0821f4190897965c33eaca7954db5f23?userId=email@example.com

Parameter

Description

Format

Required

api_key

The API key assigned to the distributor.

64a287ae534cf1bd58f45f3e23de9d433caec669

Yes

promotion_uuid

The promotion associated to the redemptions

0821f4190897965c33eaca7954db5f23

Yes

user_identifier

The ID of the user to query, this is the ID passed during redemption.

email@example.com

Yes

Response

The response data are indexed under the related entity within the data key.

{
"data": {
"total_discount_value": 300,
"total_order_value": 300,
"currency_of_totals": "GBP",
"redemption_history": [
{
"code": "WWX36TR8",
"order_value": 100,
"discount_value": 100,
"exchange_rate_currency": "GBP",
"exchange_rate": 1,
"currency": "GBP",
"custom_params": {
"p1": "parameter 1",
"p2": "parameter 2",
"p3": "parameter 3"
},
"redeemed_at": "2020-07-21T19:12:08+00:00",
"tags": []
},
{
"code": "V82Q2W2R",
"order_value": 100,
"discount_value": 100,
"exchange_rate_currency": "GBP",
"exchange_rate": 1,
"currency": "GBP",
"custom_params": null,
"redeemed_at": "2020-07-21T18:49:18+00:00",
"tags": []
},
{
"code": "FT3CV84N",
"order_value": 100,
"discount_value": 100,
"exchange_rate_currency": "GBP",
"exchange_rate": 1,
"currency": "GBP",
"custom_params": null,
"redeemed_at": "2020-07-21T18:43:52+00:00",
"tags": []
}
]
},
"errors": [],
"result": "success"
}

If the user id queried has not made any redemptions yet then the response will look as below.
{
"data": {
"total_discount_value": 0,
"total_order_value": 0,
"currency_of_totals": null,
"redemption_history": []
},
"errors": [],
"result": "success"
}

Summary data

Item

Description

Example

total_discount_value

Total of the computed value based on the offer discount information and the order_value converted to the normalised currency in currency_of_totals

80

total_order_value

Total of the value of all transactions, excluding VAT converted to the normalised currency in currency_of_totals

320

currency_of_totals

Currency of totals. This is a currency set by the merchant

GBP

Item (under redemption_history key)

Description

Example

code

Used during redemption

2HDG2KJ3

redeemed_at

The date and time that the code redemption occurred.

2015-05-29T10:39:17

order_value

The value of the transaction, excluding VAT.

219.99

discount_value

The computed value based on the offer discount information and the order_value.

11.25

currency

The currency in which the transaction took place.

GBP

exchange_rate_currency

The currency all transactions must be reported in set by the merchant

GBP

exchange_rate

The international exchange rate used to convert the total at the time of redemption. This rate will be 1:1 if the currency of the transaction matches the reporting currency

1

custom_params

An object containing custom parameter data submitted with the redemption API for reporting and data segmentation purposes.

{
"p1": "parameter 1",
"p2": "parameter 2",
"p3": "parameter 3"
}

tags

Tags are a list of labels configured for the offer.

[ "SUMMER_OFFER", "ONLINE" ]

Errors - under the errorskey

Any errors returned here indicates that the code is not valid for use by customers.

{
"data": {},
"errors": [{
"code": 202,
"message": "This code has expired and can no longer be used.",
"promotion_specific_error": null
}]
}

Error code

Message

Reason

101

Invalid API key supplied

The API key entered is not a valid API key

400

The request could not be completed- check that parameters are correct

One of the required parameters is missing or the URL is badly formed


How did we do?


Powered by HelpDocs (opens in a new tab)