Testing your implementation
To test your implementation of reservation management, the Sandbox API is provided. The following workflows provide an overview of how you can use the sandbox environment to test reservations management (where you need reservations to be uploaded to your connectivity system).
Full details about getting started with the Sandbox API are provided here.
New reservations
The following workflow describes how to create and retrieve reservations in the sandbox environment that can then be used to test your reservations management implementation.
Enable notifications for sandbox reservations. Be sure to issue requests against the sandbox LSGQL API’s endpoint:
a. Create and configure a callback configuration using the
createNotificationCallbackConfig
mutation. Be sure to use your sandbox credentials when creating the callback configuration.b. Subscribe to the
ReservationNotificationEvent
event type using thesubscribeNotificationEventType
mutation.This page provides complete details on enabling notifications.
Use the Sandbox API to create reservations in the sandbox environment, which simulates reservations that would be created by travelers. To create a sandbox dataset (reservations):
a. Obtain your access token that will be used to authenticate with the Sandbox API.
b. Create properties in the sandbox environment.
c. Create reservations in the sandbox environment. Be sure to include
sendNotification: true
in the input so that a webhook notification is sent.
Webhook notification (
ReservationNotificationEvent
) is sent to the sandbox callback URL, which includes the reservation ID and a confirmation token. Here is an example:1{2 "event_name":"ReservationNotificationEvent",3 "creation_time":"2024-07-10T09:49:08.297506452Z",4 "notification_id":"e85b23f3-5d13-412a-8a63-9a974373d0899",5 "payload": {6 "property_id": "64250",7 "reservation_id": "12345",8 "confirmation_token": "LPtu3SI+ZovWJincjJrv9+GZUpln8ofYfrKhAaWQOBM=",9 "action_type": "BOOKED",10 "property_source": "EXPEDIA_GROUP"11 }12}Retrieve reservation details from the sandbox environment using the
reservations
query. Be sure to use the sandbox’s access token, and issue the request against the sandbox LSGQL API’s endpoint. Here's a cURL example:curl --request POST \--url https://api.sandbox.expediagroup.com/supply/lodging/graphql \--header 'Authorization: Bearer {sandbox_access_token}' \--header 'Content-Type: application/json' \--data '{"query":"query {property(id: \"64250\") {id name reservations(pageSize: 10) {totalCount edges {node {id checkInDate checkOutDate status}}}}}"}'To retrieve credit card and Expedia Virtual Card (EVC) information:
a. Retrieve a token that can then be used to access the Payments API. Include the
payment
object in thereservations
query (issued against the sandbox LSGQL API’s endpoint). Here is an example:curl --request POST \--url https://api.sandbox.expediagroup.com/supply/lodging/graphql \--header 'Authorization: Bearer {sandbox_access_token}' \--header 'Content-Type: application/json' \--data '{"query":"query {property(id: \"64250\") {id name reservations(pageSize: 10) {totalCount edges {node {id checkInDate checkOutDate status payment {instrument {type token {value expirationDateTime}}}}}}}}"}'b. Retrieve the payment information for the reservation using the token. Issue the request against the sandbox version of the Payments API. Here is an example:
curl --request POST \--url https://api.sandbox.expediagroup.com/supply/payments/graphql \--header 'Authorization: Bearer {sandbox_access_token}' \--header 'Content-Type: application/json' \--data ' {"query":"query {\n paymentInstrument(token:\"token_from_res_query\") {\n \n ...on BankIssuedCard {\n customer {\n address {\n addressLines\n\t\t\t\t\t\t\t\t\t locality \n administrativeArea \n postalCode\n countryCode \n }\n fullName\n }\n expirationDate\n activationDate\n issuerName\n number\n type\n verificationNumber\n }\n }\n}"} 'Confirm the notification using the
confirmReservationNotification
mutation. Issue this request against the sandbox LSGQL API’s endpoint. Here is an example:1mutation {2 confirmReservationNotification(3 input: {4 clientMutationId: "liaj8a500ad",5 propertyId: "64250",6 reservationId: "12345",7 confirmationToken: "LPtu3SI+ZovWJincjJrv9+GZUpln8ofYfrKhAaWQOBM=",8 confirmationCode: "59aoi9alje",9 actionType: "BOOKED"10 }11 ) {12 clientMutationId13 reservation {14 id15 }16 }17}Test your reservation management implementation by issuing query and mutation requests against the sandbox data (using the sandbox LSGQL API endpoint).
Note that all reservation queries and mutations are supported as documented, except for the
property
query. Only theid
andname
fields are available on theProperty
type.Cleanup (delete) test data (properties and reservations) in the sandbox environment, as necessary.
Modified reservations
This workflow assumes that the steps in New reservations above have been completed. In particular, if notifications are not confirmed, additional notifications are not sent when a reservation is modified.
Update one or more sandbox reservations, as necessary. Be sure to include
sendNotification: true
in the input so that a webhook notification is sent.Webhook notification (
ReservationNotificationEvent
) is sent to the sandbox callback URL, which includes the reservation ID and a confirmation token. Here is an example:1{2 "event_name":"ReservationNotificationEvent",3 "creation_time":"2024-07-10T09:49:08.297506452Z",4 "notification_id":"e85b23f3-5d13-412a-8a63-9a974373d0899",5 "payload": {6 "property_id": "64250",7 "reservation_id": "100000936",8 "confirmation_token": "tL9tLTvSXLiIcjWWb2W0h1PIytNTUHkpxtkvwNbrdLk=",9 "action_type": "MODIFIED",10 "property_source": "EXPEDIA_GROUP"11 }12}Retrieve reservations from the sandbox environment using the
reservations
query. Be sure to use the sandbox’s access token, and issue the request against the sandbox LSGQL API’s endpoint. Here is a cURL example:curl --request POST \--url https://api.sandbox.expediagroup.com/supply/lodging/graphql \--header 'Authorization: Bearer {sandbox_access_token}' \--header 'Content-Type: application/json' \--data '{"query":"query {property(id: \"64250\") {id name reservations(pageSize: 10) {totalCount edges {node {id checkInDate checkOutDate status}}}}}"}'Confirm the notification using the
confirmReservationNotification
mutation. Issue this request against the sandbox LSGQL API’s endpoint. Here is an example:1mutation {2 confirmReservationNotification(3 input: {4 clientMutationId: "liaj8a500ad",5 propertyId: "64250",6 reservationId: "100000936",7 confirmationToken: "tL9tLTvSXLiIcjWWb2W0h1PIytNTUHkpxtkvwNbrdLk=",8 confirmationCode: "689oi9isakadl",9 actionType: "MODIFIED"10 }11 ) {12 clientMutationId13 reservation {14 id15 }16 }17}Cleanup (delete) test data (properties and reservations) in the sandbox environment, as necessary.