Get Compensation by Coupon Code or Confirmation Number
1 min
GET
https://api.b.preview.loyaltyservices.io/api/v4/compensation
Query Parameters
- couponCodestringDescriptionMin Length0Max Length200
- confirmationNumberstringDescriptionMin Length0Max Length100
Responses
200
- CompensationsResponseV4
- compensationsCompensation[]Description
- compensationIdnumberDescription
- couponCoupon
- couponIdinteger<int64>ExampleDescriptionFormatint64
- couponRequestIdinteger<int64>ExampleDescriptionFormatint64
- offerOfferDescription
- offerIdinteger<int64>ExampleDescriptionFormatint64
- offerTypeCodestringrequiredExampleDescription
- codestringExampleDescription
- namestringExampleDescription
- descriptionstringExampleDescription
- featureVersioninteger<int32>ExampleDescriptionFormatint32
- statusCodestringrequiredExampleDescription
- startDateTimestring<date-time>DescriptionFormatdate-time
- endDateTimestring<date-time>DescriptionFormatdate-time
- offerAttributesOfferAttribute[]Description
- offerAttributeIdinteger<int64>ExampleDescriptionFormatint64
- attributeAttributerequired
- attributeIdinteger<int64>ExampleDescriptionFormatint64
- typeCodestringrequiredExampleDescription
- statusCodestringrequiredExampleDescription
- namestringExampleDescription
- descriptionstringExampleDescription
- dataTypeCodestringrequiredExampleDescription
- defaultValuestringExampleDescription
- requireOnUsebooleanExampleDescription
- requireOnHoldbooleanExampleDescription
- includeOnResponsebooleanDescription
- attributeTypeCodestringExampleDescription
- operatorCodestringExampleDescription
- operandstringExampleDescription
- smartGroupIdinteger<int64>ExampleDescriptionFormatint64
- codestringExampleDescription
- statusCodestringExampleDescription
- startDatestring<date>DescriptionFormatdate
- endDatestring<date>DescriptionFormatdate
- useTypeCodestringExampleDescriptionDefaultSingle
- useLimitinteger<int32>ExampleDescriptionDefault1Formatint32
- currentUseinteger<int32>ExampleDescriptionFormatint32
- couponUsesCouponUse[]Description
- useDateTimestring<date-time>DescriptionFormatdate-time
- statusCodestringrequiredExampleDescription
- channelCodestringrequiredExampleDescription
- aliasstringDescription
- useCountinteger<int32>requiredExampleDescriptionFormatint32
- couponUseAttributesCouponUseAttribute[]Description
- couponUseAttributeIdinteger<int64>ExampleDescriptionFormatint64
- attributeAttributerequired
- attributeIdinteger<int64>ExampleDescriptionFormatint64
- typeCodestringrequiredExampleDescription
- statusCodestringrequiredExampleDescription
- namestringExampleDescription
- descriptionstringExampleDescription
- dataTypeCodestringrequiredExampleDescription
- valuestringExampleDescription
- couponAttributesCouponAttribute[]Description
- couponAttributeIdinteger<int64>ExampleDescriptionFormatint64
- attributeAttributerequired
- attributeIdinteger<int64>ExampleDescriptionFormatint64
- typeCodestringrequiredExampleDescription
- statusCodestringrequiredExampleDescription
- namestringExampleDescription
- descriptionstringExampleDescription
- dataTypeCodestringrequiredExampleDescription
- valuestringExampleDescription
- requireOnUsebooleanExampleDescription
- requireOnHoldbooleanDescription
- accountNumberstringDescription
- confirmationNumberstringDescription
- startDateTimestring<date-time>DescriptionFormatdate-time
- endDateTimestring<date-time>DescriptionFormatdate-time
- compensationStatusstringExampleDescription
- commentstringDescription
- reasonstringDescription
- typestringDescription
- 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
- compensationNightsCompensationNight[]Description
- compensationDatestring<date>DescriptionFormatdate
- compensationNightStatusstringExampleDescription
- commentsstringDescription
- compensationDetailAmountsCompensationDetailAmount[]Description
- couponUseAmountnumberrequiredDescription
- categorystringrequiredDescription
- reasonstringrequiredDescription
400
- ErrorResponse
- errorsValidationError[]Description
- codestringDescription
- fieldNamestringDescription
- messagestringDescription
- messageParametersobject[]Description
401
403
500
curl
curl --request GET \
--url https://api.b.preview.loyaltyservices.io/api/v4/compensation \
--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/v4/compensation", 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/v4/compensation")
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/v4/compensation"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Success
{
"compensations": [
{
"compensationId": 0,
"coupon": {
"couponId": 147258369,
"couponRequestId": 147258370,
"offer": {
"offerId": 147258369,
"offerTypeCode": "Discount",
"code": "ALON2020",
"name": "Free night",
"description": "Award double points",
"featureVersion": 2,
"statusCode": "Enabled",
"startDateTime": "",
"endDateTime": "",
"offerAttributes": [
{
"offerAttributeId": 147258369,
"attribute": {
"attributeId": 147258369,
"typeCode": "Validation",
"statusCode": "Enabled",
"name": "AccountNumber",
"description": "Account Number",
"dataTypeCode": "open"
},
"defaultValue": "Standard",
"requireOnUse": true,
"requireOnHold": true,
"includeOnResponse": false,
"attributeTypeCode": "Validation",
"operatorCode": "EQ",
"operand": "GI",
"smartGroupId": 147258369
}
]
},
"code": "ZPVWTAROW2OQ",
"statusCode": "Activated",
"startDate": "",
"endDate": "",
"useTypeCode": "Single",
"useLimit": 1,
"currentUse": 1,
"couponUses": [
{
"useDateTime": "",
"statusCode": "Used",
"channelCode": "System",
"alias": "",
"useCount": 1,
"couponUseAttributes": [
{
"couponUseAttributeId": 147258369,
"attribute": {
"attributeId": 147258369,
"typeCode": "Validation",
"statusCode": "Enabled",
"name": "AccountNumber",
"description": "Account Number",
"dataTypeCode": "open"
},
"value": "Standard"
}
]
}
],
"couponAttributes": [
{
"couponAttributeId": 147258369,
"attribute": {
"attributeId": 147258369,
"typeCode": "Validation",
"statusCode": "Enabled",
"name": "AccountNumber",
"description": "Account Number",
"dataTypeCode": "open"
},
"value": "2021-12-31T12:00:00",
"requireOnUse": true,
"requireOnHold": false
}
]
},
"accountNumber": "",
"confirmationNumber": "",
"startDateTime": "",
"endDateTime": "",
"compensationStatus": "Processed",
"comment": "",
"reason": "",
"type": "",
"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": ""
},
"compensationNights": [
{
"compensationDate": "",
"compensationNightStatus": "Processed",
"comments": "",
"compensationDetailAmounts": [
{
"couponUseAmount": 0,
"category": "",
"reason": ""
}
]
}
]
}
]
}400
// Bad request
{
"errors": [
{
"code": "",
"fieldName": "",
"message": "",
"messageParameters": [
{}
]
}
]
}401
// Unauthorized
403
// Forbidden
500
// Internal error