Edit Compensation Nights
1 min
PATCH
https://api.b.preview.loyaltyservices.io/api/v5/compensation/{compensationId}/nights
Path Parameters
- compensationIdinteger<int64>requiredDescriptionFormatint64
Responses
200
- CompensationNight[]
- 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 PATCH \
--url https://api.b.preview.loyaltyservices.io/api/v5/compensation/{compensationId}/nights \
--header 'accept: application/json'ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.b.preview.loyaltyservices.io/api/v5/compensation/{compensationId}/nights")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/merge-patch+json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.b.preview.loyaltyservices.io/api/v5/compensation/{compensationId}/nights"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/merge-patch+json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/merge-patch+json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.b.preview.loyaltyservices.io/api/v5/compensation/{compensationId}/nights")
.method("PATCH", body)
.addHeader("accept", "application/json")
.addHeader("content-type", "application/merge-patch+json")
.build();
Response response = client.newCall(request).execute();200
// Success
[
{
"compensationDate": "",
"compensationNightStatus": "Processed",
"comments": "",
"compensationDetailAmounts": [
{
"couponUseAmount": 0,
"category": "",
"reason": ""
}
]
}
]400
// Bad request
{
"errors": [
{
"code": "",
"fieldName": "",
"message": "",
"messageParameters": [
{}
]
}
]
}401
// Unauthorized
403
// Forbidden
500
// Internal error