Get Compensation by Coupon Code
1 min
GET
https://api.b.preview.loyaltyservices.io/api/v3/compensation/coupons/{couponCode}
Path Parameters
- couponCodestringrequiredDescriptionMin Length1Max Length200
Responses
200
- CompensationsResponse
- compensationsCompensationDetail[]Description
- accountingPeriodinteger<int32>DescriptionFormatint32
- runStatusstringExampleDescription
- typestringExampleDescription
- reasonstringExampleDescription
- couponCodestringDescription
- totalAmountnumberDescription
- compensationDetailsCompensationDetailItem[]Description
- couponUseAmountnumberDescription
- confirmationNumberstringDescription
- startDateTimestring<date-time>DescriptionFormatdate-time
- endDateTimestring<date-time>DescriptionFormatdate-time
- customDataCustomData
- ace01stringDescription
- ace01DescriptionstringDescription
- ace02stringDescription
- ace02DescriptionstringDescription
- ace03stringDescription
- ace03DescriptionstringDescription
- ace04stringDescription
- ace04DescriptionstringDescription
- ace05stringDescription
- ace05DescriptionstringDescription
- ace06stringDescription
- ace06DescriptionstringDescription
- ace07stringDescription
- ace07DescriptionstringDescription
- ace08stringDescription
- ace08DescriptionstringDescription
- ace09stringDescription
- ace09DescriptionstringDescription
- ace10stringDescription
- ace10DescriptionstringDescription
- ace11stringDescription
- ace11DescriptionstringDescription
- ace12stringDescription
- ace12DescriptionstringDescription
- ace13stringDescription
- ace13DescriptionstringDescription
- ace14stringDescription
- ace14DescriptionstringDescription
- ace15stringDescription
- ace15DescriptionstringDescription
400
- ErrorResponse
- errorsValidationError[]Description
- codestringDescription
- fieldNamestringDescription
- messagestringDescription
- messageParametersobject[]Description
401
403
500
curl
curl --request GET \
--url https://api.b.preview.loyaltyservices.io/api/v3/compensation/coupons/{couponCode} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.b.preview.loyaltyservices.io/api/v3/compensation/coupons/{couponCode}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.b.preview.loyaltyservices.io/api/v3/compensation/coupons/{couponCode}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.b.preview.loyaltyservices.io/api/v3/compensation/coupons/{couponCode}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Success
{
"compensations": [
{
"accountingPeriod": "",
"runStatus": "Processed",
"type": "Calculated",
"reason": "NORULE",
"couponCode": "",
"totalAmount": 0,
"compensationDetails": [
{
"couponUseAmount": 0,
"confirmationNumber": "",
"startDateTime": "",
"endDateTime": "",
"customData": {
"ace01": "",
"ace01Description": "",
"ace02": "",
"ace02Description": "",
"ace03": "",
"ace03Description": "",
"ace04": "",
"ace04Description": "",
"ace05": "",
"ace05Description": "",
"ace06": "",
"ace06Description": "",
"ace07": "",
"ace07Description": "",
"ace08": "",
"ace08Description": "",
"ace09": "",
"ace09Description": "",
"ace10": "",
"ace10Description": "",
"ace11": "",
"ace11Description": "",
"ace12": "",
"ace12Description": "",
"ace13": "",
"ace13Description": "",
"ace14": "",
"ace14Description": "",
"ace15": "",
"ace15Description": ""
}
}
]
}
]
}400
// Bad request
{
"errors": [
{
"code": "",
"fieldName": "",
"message": "",
"messageParameters": [
{}
]
}
]
}401
// Unauthorized
403
// Forbidden
500
// Internal error