Skip to navigation

Code examples

JSON request and response examples for the server-side services

Credentials and the ACCAM in these examples are placeholders. Replace them with the values Allianz Partners issues you.

Quote requests

Send a quote request to POST /optimizations. The request shape depends on what the customer is booking.

Travel quote request
{
"credentials": {
"password": "YOUR_PASSWORD",
"userName": "YOUR_USERNAME"
},
"customers": [
{
"address": {
"city": "Richmond",
"country": "US",
"postalCode": "23238",
"region": "VA"
},
"birthDate": "1997-12-01",
"customerId": "d6d605249c93b6c9114d10daf0193de6",
"customerType": "PRIMARY",
"firstName": "Jane",
"gender": "Female",
"lastName": "Doe",
"memberships": [
{
"name": "Premium Member",
"type": "Basic"
}
],
"sequence": 0,
"age": 26
},
{
"birthDate": "1963-11-01",
"customerType": "OTHER",
"firstName": "John",
"gender": "Male",
"lastName": "Doe",
"sequence": 1,
"age": 60
}
],
"gadget": {
"browserType": "Chrome",
"browserVersion": "95.0.4638.69",
"deviceCategory": "Desktop",
"deviceType": "Personal Computer",
"operatingSystem": "Windows",
"operatingSystemVersion": "10",
"requestingPlatform": "None",
"userAgent": ""
},
"partner": {
"externalCode": "F999999"
},
"providers": [
{
"providerCode": "114",
"providerName": "Sunshine Air"
}
],
"requestDetail": {
"availablePoints": "",
"businessUnit": "US",
"currency": "USD",
"costIncludes": [
"Air"
],
"itemdeliverymethod": "email",
"language": "en",
"offerVersionId": 2,
"redemtpionPoints": "",
"requestCategories": [
"Airfare"
],
"requestChannel": "Online",
"requestedDate": "2026-10-13T20:08:03",
"requestOrigin": "Standard",
"requestOriginPage": "",
"sessionId": "A692B1864E6B029D683BD66203BDD208",
"trafficSource": "",
"transactionId": "P0424202441"
},
"travel": {
"classofService": "COACH_CLASS",
"departureDate": "2024-12-24T03:32:00-4:00",
"destination": {
"city": "Punta Gorda",
"code": "PGD",
"country": "US",
"region": "FL"
},
"includesConnection": "False",
"isDomestic": true,
"origin": {
"city": "Richmond",
"code": "RIC",
"country": "US",
"region": "VA"
},
"refundable": "False",
"rewardMiles": "",
"returnDate": "2024-12-29T23:32:15-4:00",
"totalCost": 1250.84,
"travelAgent": "Travel Agent 007",
"travelSegments": [
{
"destination": {
"code": "PGD"
},
"origin": {
"code": "RIC"
},
"routeGroup": "12345",
"sequence": 0,
"travelLegs": [
{
"classOfService": "COACH_CLASS",
"destination": {
"code": "ATL"
},
"fareClass": "DD",
"isDomestic": true,
"origin": {
"code": "RIC"
},
"routeNumber": "111222",
"sequence": 0
},
{
"classOfService": "COACH_CLASS",
"destination": {
"code": "PGD"
},
"fareClass": "DX",
"isDomestic": true,
"origin": {
"code": "ATL"
},
"routeNumber": "222333",
"sequence": 1
}
]
},
{
"destination": {
"code": "RIC"
},
"origin": {
"code": "PGD"
},
"routeGroup": "23456",
"sequence": 1,
"travelLegs": [
{
"classOfService": "COACH_CLASS",
"destination": {
"code": "ATL"
},
"fareClass": "DX",
"isDomestic": true,
"origin": {
"code": "PGD"
},
"routeNumber": "333444",
"sequence": 0
},
{
"classOfService": "COACH_CLASS",
"destination": {
"code": "RIC"
},
"fareClass": "DD",
"isDomestic": true,
"origin": {
"code": "ATL"
},
"routeNumber": "444555",
"sequence": 1
}
]
}
],
"tripIndicator": "ROUND_TRIP",
"travelPurpose": "Leisure"
},
"features": [
{
"code": "GRUP_21301",
"alternatives": [
"1124521"
]
}
]
}

Purchase

Send the purchase to POST /Purchase when the customer buys the insurance.

{
"Partner": {
"UserID": "sampleuser",
"Password": "YOUR_PASSWORD"
},
"PurchasesRequest": {
"Accam": "YOUR_ACCAM",
"BusinessUnit": "US",
"TransactionID": "CDJSONTesting",
"Purchases": {
"Purchase": [
{
"PartnerBookingID": "CDJSON0011",
"InsuranceBookingDetails": {
"PurchaseDateTime": "2026-10-13T20:08:01",
"Method": "ONLINE",
"Status": "NEW",
"Type": "ADD",
"Currency": "USD",
"TotalCoverageAmount": "764.02",
"TotalPrice": "56.0",
"TotalPremiumPrice": "56.0",
"Purchaser": {
"FirstName": "John",
"MiddleInitial": "T",
"LastName": "Doe",
"BillingAddress": {
"Street": "1234 Road Street",
"Street2": "",
"City": "St Paul",
"Region": "MN",
"PostalCode": "55105",
"Country": "US"
},
"EmailAddress": "noreply@allianz.com",
"PhoneNumber": "14163565173"
},
"FulfillmentMethod": "EMAIL",
"PaymentMethod": "CC",
"CreditCard": {
"CardholderName": "John Doe",
"ExpireMonth": "5",
"ExpireYear": "2021",
"CardNumber": "4012XXXXXXXX0026",
"CardType": "VI",
"SecurityCode": ""
}
},
"GadgetDetails": {
"BrowserType": "",
"BrowserVersion": "",
"DeviceCategory": "",
"DeviceType": "",
"OperatingSystem": "",
"OperatingSystemVersion": "",
"RequestingPlatform": "",
"RequestingPlatformVersion": ""
},
"TravelBookingDetails": {
"Currency": "USD",
"TotalTripCost": "764.02",
"TotalMiles": "1",
"PNR": "123DD",
"DepositDate": "2026-10-13T20:08:01",
"CustomerID": "12345",
"TravelAgent": "www.sampleagent.com"
},
"TravelDetails": {
"DepartureDate": "2026-11-02",
"ReturnDate": "2026-11-07",
"RentalCarStartDate": "",
"RentalCarEndDate": "",
"Origin": {
"Code": "LAX",
"Region": "CA",
"Country": "US"
},
"Destination": {
"Code": "LHR",
"Region": "",
"Country": "GB"
},
"Providers": {
"Provider": [
{
"Code": "",
"Name": "www.travelagent.com"
}
]
},
"RentalCarAgency": ""
},
"ProductDetails": {
"Product": [
{
"Sequence": "0",
"QuoteID": "1234567890",
"ProductID": "001003926",
"InsuredDetails": {
"Insured": [
{
"InsuredSequence": "0",
"InsuredType": "PRIMARY",
"FirstName": "John",
"MiddleInitial": "T",
"LastName": "Doe",
"Birthdate": "1984-10-28",
"Gender": "Male",
"IPaddress": "",
"InsuredAddress": {
"Street": "123 Summit Ave",
"Street2": "",
"City": "St Paul",
"Region": "MN",
"PostalCode": "55105",
"Country": "USA"
},
"PhoneNumber": "1234567890",
"CustomerID": "12345",
"NumberOfRooms": "",
"Memberships": {
"Name": "TopBuyer",
"Type": "Gold",
"Number": "123456"
}
},
{
"InsuredSequence": "1",
"InsuredType": "Other",
"FirstName": "John",
"LastName": "Doe",
"InsuredAddress": {
"Region": "MN",
"PostalCode": "55105",
"Country": "USA"
}
}
]
},
"CoverageAmount": "764.02",
"Price": "56.0",
"PremiumPrice": "56.0",
"ProductBookingID": "CDJSON00011"
}
]
}
}
]
}
}
}

Decision

Report the outcome to POST /decisions when the booking completes.

{
"credentials": {
"UserID": "sampleuser",
"Password": "YOUR_PASSWORD"
},
"bookingId": "PB19201320016",
"businessUnit": "US",
"currencyType": "USD",
"cxid": "4153734951086967828",
"responseId": "4153734951086967827",
"responseType": "Purchased",
"details": [
{
"responseType": "Declined",
"supplierCode": "AWP",
"productCode": "001004512",
"purchasePrice": 75.0,
"quantity": 1,
"responseQuoteId": "4153734951086967835"
}
],
"localTs": "2024-05-16T02:48:29.442"
}

OpenAPI examples

Sample code