Coupon Redemption
Code of a coupon
The tenant that the caller is acting upon.
Please note that this value is always lowercase.
The list of comma-separated properties used to sort the results. By default, the column values are sorted in ascending order. Can either be in the form of fieldName or fieldName:asc,fieldName:desc. If you want to sort by localized attributes, you must use the following form: fieldName.language or fieldName.language:asc,fieldName.language:desc.
The page number to be retrieved where the size of the pages must be specified by the pageSize parameter. The number of the first page is 1.
1
The number of documents being retrieved on the page.
16
This parameter requests to return the total number of object in the collection fulfilling the criteria together with the response. This number will be returned in the 'items-count' header.
The simple query criteria based on available fields to limit returned results or a set of modified documents.
List of redemptions
Request syntactically incorrect. Any details will be provided within the response payload.
Example response
Access forbidden. The caller is not allowed to access this resource.
The requested resource does not exist.
Some server side error occurred.
GET /coupon/{tenant}/coupons/{code}/redemptions HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
{
"id": "6429b8fdf8fd8e0001df1617",
"code": "10-OFF",
"customerNumber": "61443563",
"orderTotal": {
"amount": 299.3,
"currency": "USD"
},
"discount": {
"amount": 29.93,
"currency": "USD"
},
"redeemedAt": "2023-04-02T17:18:53.701Z"
},
{
"id": "642aa7f5f8fd8e0001df161b",
"code": "10-OFF",
"customerNumber": "61443563",
"orderTotal": {
"amount": 369.07,
"currency": "USD"
},
"discount": {
"amount": 36.91,
"currency": "USD"
},
"redeemedAt": "2023-04-03T10:18:29.233Z"
}
]
Invalidate the coupon based on its validity scope. Redemption is not possible when the coupon has exceeded its maximum number allowed redemptions. To be redeemed a coupon needs to be already valid and not expired yet.
The endpoint was previously available under the
/coupon-v2/
base path.
Required scopes
coupon.coupon_redeem_on_behalf
- needed only if the service should use the customer identification specified in the request body (customerNumber
attribute) instead of the one associated with current authentication token.
Code of a coupon
The tenant that the caller is acting upon.
Please note that this value is always lowercase.
Defines a coupon redemption request payload that affects a coupon instance.
Code of the associated order.
The customer Id of the user, e.g. C0123456789. Can be specified only if coupon.coupon_redeem_on_behalf scope is present.
The id of the legal entity to which customer is assigned. When customer is assigned to many legal entities then he can redeem the same coupon separately for each legal entity.
The amount of the purchase.
The absolute amount of the granted discount.
The coupon has been redeemed and the redemption has been successfully created.
Request syntactically incorrect. Any details will be provided within the response payload.
Example response
Access forbidden. The caller is not allowed to access this resource.
The requested resource does not exist.
Creation failed because there was a conflict with another resource. Any details will be provided within the response payload.
Some server side error occurred.
POST /coupon/{tenant}/coupons/{code}/redemptions HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 118
{
"customerNumber": "CustomerId",
"orderTotal": {
"amount": 1090,
"currency": "EUR"
},
"discount": {
"amount": 5,
"currency": "EUR"
}
}
{
"id": "6058912da917ae6f360f2557"
}
Retrieves a single redemption.
The endpoint was previously available under the
/coupon-v2/
base path.
Required scopes
coupon.coupon_manage
for accessing any redemption.coupon.coupon_redeem
for accessing only redemption created by current user.coupon.coupon_redeem_on_behalf
- needed only if the service should use the customer identification specified in the request body (customerNumber
attribute) instead of the one associated with current authentication token.
Code of a coupon
The tenant that the caller is acting upon.
Please note that this value is always lowercase.
Customer number (ID) of customer on behalf of which we request coupon information. Needed only in case of retrieving coupon eligible for other customer than the caller.
The coupon redemption has been successfully retrieved.
Request syntactically incorrect. Any details will be provided within the response payload.
Example response
Access forbidden. The caller is not allowed to access this resource.
The requested resource does not exist.
Some server side error occurred.
GET /coupon/{tenant}/coupons/{code}/redemptions/{id} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"id": "6429b8fdf8fd8e0001df1617",
"code": "10-OFF",
"customerNumber": "61443563",
"orderTotal": {
"amount": 299.3,
"currency": "USD"
},
"discount": {
"amount": 29.93,
"currency": "USD"
},
"redeemedAt": "2023-04-02T17:18:53.701Z"
}
Code of a coupon
The tenant that the caller is acting upon.
Please note that this value is always lowercase.
A redemption with the provided code has been successfully deleted.
Request syntactically incorrect. Any details will be provided within the response payload.
Example response
Access forbidden. The caller is not allowed to access this resource.
The requested resource does not exist.
Some server side error occurred.
DELETE /coupon/{tenant}/coupons/{code}/redemptions/{id} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
No content
Was this helpful?