All URIs are relative to https://airlines-api.hopper.com/airline/v1.1
| Method | HTTP request | Description |
|---|---|---|
| getDgContractsId | GET /dg_contracts/{id} | Get a DG contract |
| postDgContractExercises | POST /dg_contract_exercises | Create DG Exercise |
| postDgContracts | POST /dg_contracts | Create a DG Contract |
| postDgContractsIdPayment | POST /dg_contracts/{id}/payment | Process DG payment |
| postDgOffers | POST /dg_offers | Create DG Offers |
| putDgContractsIdItinerarySlices | PUT /dg_contracts/{id}/itinerary_slices | Update DG Contract Itinerary Slices |
| putDgContractsIdUpdateStatus | PUT /dg_contracts/{id}/update_status | Update DG Contract Status |
DgContract getDgContractsId(id)
Get a DG contract
Get a DG contract
// Import classes:
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.auth.*;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.DisruptionGuaranteeDgApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
// Configure HTTP bearer authorization: PartnerAuth
HttpBearerAuth PartnerAuth = (HttpBearerAuth) defaultClient.getAuthentication("PartnerAuth");
PartnerAuth.setBearerToken("BEARER TOKEN");
DisruptionGuaranteeDgApi apiInstance = new DisruptionGuaranteeDgApi(defaultClient);
String id = "id_example"; // String | A unique identifier for a contract
try {
DgContract result = apiInstance.getDgContractsId(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DisruptionGuaranteeDgApi#getDgContractsId");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | A unique identifier for a contract |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The requested DG contract | * Expires - * Cache-Control - |
| 400 | Syntactic errors were encountered while handling the request | - |
| 401 | The client could not be authenticated | - |
| 403 | The authenticated client does not have permission to call this endpoint | - |
| 404 | The requested resource could not be found | - |
| 422 | Semantic errors were encountered while handling the request | - |
| 500 | The server encountered an internal error | - |
CreateDgContractExerciseResponse postDgContractExercises(createDgContractExerciseRequest, hcSessionID)
Create DG Exercise
Record that a request to exercise a DG contract has occurred.
// Import classes:
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.auth.*;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.DisruptionGuaranteeDgApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
// Configure HTTP bearer authorization: PartnerAuth
HttpBearerAuth PartnerAuth = (HttpBearerAuth) defaultClient.getAuthentication("PartnerAuth");
PartnerAuth.setBearerToken("BEARER TOKEN");
DisruptionGuaranteeDgApi apiInstance = new DisruptionGuaranteeDgApi(defaultClient);
CreateDgContractExerciseRequest createDgContractExerciseRequest = new CreateDgContractExerciseRequest(); // CreateDgContractExerciseRequest |
String hcSessionID = "9fd3f2f9-e5aa-4128-ace9-3c4ee37b685f"; // String | The ID of the current airline session, see [Sessions](#tag/Sessions)
try {
CreateDgContractExerciseResponse result = apiInstance.postDgContractExercises(createDgContractExerciseRequest, hcSessionID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DisruptionGuaranteeDgApi#postDgContractExercises");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| createDgContractExerciseRequest | CreateDgContractExerciseRequest | ||
| hcSessionID | String | The ID of the current airline session, see Sessions | [optional] |
CreateDgContractExerciseResponse
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | The created DG contract exercise | * Expires - * Cache-Control - * HTS-Session-ID - The ID of the current session, see Sessions |
| 400 | Syntactic errors were encountered while handling the request | - |
| 401 | The client could not be authenticated | - |
| 403 | The authenticated client does not have permission to call this endpoint | - |
| 404 | The requested resource could not be found | - |
| 422 | Semantic errors were encountered while handling the request | - |
| 500 | The server encountered an internal error | - |
DgContract postDgContracts(createDgContractRequest)
Create a DG Contract
Create a DG contract from selected DG offer(s).
// Import classes:
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.auth.*;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.DisruptionGuaranteeDgApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
// Configure HTTP bearer authorization: PartnerAuth
HttpBearerAuth PartnerAuth = (HttpBearerAuth) defaultClient.getAuthentication("PartnerAuth");
PartnerAuth.setBearerToken("BEARER TOKEN");
DisruptionGuaranteeDgApi apiInstance = new DisruptionGuaranteeDgApi(defaultClient);
CreateDgContractRequest createDgContractRequest = new CreateDgContractRequest(); // CreateDgContractRequest |
try {
DgContract result = apiInstance.postDgContracts(createDgContractRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DisruptionGuaranteeDgApi#postDgContracts");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| createDgContractRequest | CreateDgContractRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | The created DG contract | * Expires - * Cache-Control - |
| 204 | The DG contract creation request was successfully validated but not performed | * Expires - * Cache-Control - |
| 400 | Syntactic errors were encountered while handling the request | - |
| 401 | The client could not be authenticated | - |
| 403 | The authenticated client does not have permission to call this endpoint | - |
| 404 | The requested resource could not be found | - |
| 422 | Semantic errors were encountered while handling the request | - |
| 500 | The server encountered an internal error | - |
DgPayment postDgContractsIdPayment(id, processDgPaymentRequest)
Process DG payment
When HTS is the Merchant of Record (MoR), the customer's credit card is charged by HTS for the DG fee. HTS is relying on an external payment gateway to process the payments, it allows the partner airline to tokenize the customer's credit card details and then pass the generated token in HTS Ancillaries for Airlines API payment endpoints in order to process the payment and confirm the contract related to the purchased product. Token URL: https://core.spreedly.com/v1/payment_methods.json Example Token Request: ``` curl --request POST --url https://core.spreedly.com/v1/payment_methods.json --header 'content-type: application/json' -u "login:password" --data '{ "payment_method": { "email": "aaa@bbb.ccc", "credit_card": { "number": "4111111111111111", "month": "09", "year": "2029", "first_name": "John", "last_name": "Smith", "address1": "123 12th St", "address2": "Building B", "city": "Quebec City", "state": "QC", "zip": "G1R 4S9", "country": "CA", "verification_value": "123" } } }' ``` Example Token Response: ``` { "transaction": { "token": "KtToV20m9qT1Yi8pbTeLNz0Ypns", "created_at": "2023-11-29T13:31:56Z", "updated_at": "2023-11-29T13:31:56Z", "succeeded": true, "transaction_type": "AddPaymentMethod", "retained": false, "state": "succeeded", "message_key": "messages.transaction_succeeded", "message": "Succeeded!", "payment_method": { "token": "MxyYEhDK12CUAA18bJDkAq0ab3y", "created_at": "2023-11-29T13:31:56Z", "updated_at": "2023-11-29T13:31:56Z", "email": "aaa@bbb.ccc", "data": null, "storage_state": "cached", "test": true, "metadata": null, "callback_url": null, "last_four_digits": "1111", "first_six_digits": "411111", "card_type": "visa", "first_name": "John", "last_name": "Smith", "month": 9, "year": 2029, "address1": "123 12th St", "address2": "Building B", "city": "Quebec City", "state": "QC", "zip": "G1R 4S9", "country": "CA", "phone_number": null, "company": null, "full_name": "John Smith", "eligible_for_card_updater": true, "shipping_address1": null, "shipping_address2": null, "shipping_city": null, "shipping_state": null, "shipping_zip": null, "shipping_country": null, "shipping_phone_number": null, "issuer_identification_number": "41111111", "click_to_pay": false, "managed": true, "payment_method_type": "credit_card", "errors": [], "bin_metadata": { "message": "BIN Metadata is available only to Advanced Vault enrolled customers and payment methods. Reach out to your account representative for more details." }, "fingerprint": "7ccffcf38900f224fc946cf2a9c8e260072b", "verification_value": "XXX", "number": "XXXX-XXXX-XXXX-1111" } } } ``` Here the returned payment method token MxyYEhDK12CUAA18bJDkAq0ab3y has to be used in the Process DG Payment request below.
// Import classes:
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.auth.*;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.DisruptionGuaranteeDgApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
// Configure HTTP bearer authorization: PartnerAuth
HttpBearerAuth PartnerAuth = (HttpBearerAuth) defaultClient.getAuthentication("PartnerAuth");
PartnerAuth.setBearerToken("BEARER TOKEN");
DisruptionGuaranteeDgApi apiInstance = new DisruptionGuaranteeDgApi(defaultClient);
String id = "id_example"; // String | A unique identifier for a contract
ProcessDgPaymentRequest processDgPaymentRequest = new ProcessDgPaymentRequest(); // ProcessDgPaymentRequest |
try {
DgPayment result = apiInstance.postDgContractsIdPayment(id, processDgPaymentRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DisruptionGuaranteeDgApi#postDgContractsIdPayment");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | A unique identifier for a contract | |
| processDgPaymentRequest | ProcessDgPaymentRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The contract has been paid | * Expires - * Cache-Control - |
| 400 | Syntactic errors were encountered while handling the request | - |
| 401 | The client could not be authenticated | - |
| 403 | The authenticated client does not have permission to call this endpoint | - |
| 404 | The requested resource could not be found | - |
| 422 | Semantic errors were encountered while handling the request | - |
| 500 | The server encountered an internal error | - |
List<CreateDgOfferItemResponse> postDgOffers(createDgOffersRequest, hcSessionID)
Create DG Offers
Create DG offers for a user's trip
// Import classes:
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.auth.*;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.DisruptionGuaranteeDgApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
// Configure HTTP bearer authorization: PartnerAuth
HttpBearerAuth PartnerAuth = (HttpBearerAuth) defaultClient.getAuthentication("PartnerAuth");
PartnerAuth.setBearerToken("BEARER TOKEN");
DisruptionGuaranteeDgApi apiInstance = new DisruptionGuaranteeDgApi(defaultClient);
CreateDgOffersRequest createDgOffersRequest = new CreateDgOffersRequest(); // CreateDgOffersRequest |
String hcSessionID = "9fd3f2f9-e5aa-4128-ace9-3c4ee37b685f"; // String | The ID of the current airline session, see [Sessions](#tag/Sessions)
try {
List<CreateDgOfferItemResponse> result = apiInstance.postDgOffers(createDgOffersRequest, hcSessionID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DisruptionGuaranteeDgApi#postDgOffers");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| createDgOffersRequest | CreateDgOffersRequest | ||
| hcSessionID | String | The ID of the current airline session, see Sessions | [optional] |
List<CreateDgOfferItemResponse>
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | The created DG offers | * Expires - * Cache-Control - * HTS-Session-ID - The ID of the current session, see Sessions |
| 400 | Syntactic errors were encountered while handling the request | - |
| 401 | The client could not be authenticated | - |
| 403 | The authenticated client does not have permission to call this endpoint | - |
| 404 | The requested resource could not be found | - |
| 422 | Semantic errors were encountered while handling the request | - |
| 500 | The server encountered an internal error | - |
DgContract putDgContractsIdItinerarySlices(id, dgItinerarySlice)
Update DG Contract Itinerary Slices
Update itinerary slices of a DG contract.
// Import classes:
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.auth.*;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.DisruptionGuaranteeDgApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
// Configure HTTP bearer authorization: PartnerAuth
HttpBearerAuth PartnerAuth = (HttpBearerAuth) defaultClient.getAuthentication("PartnerAuth");
PartnerAuth.setBearerToken("BEARER TOKEN");
DisruptionGuaranteeDgApi apiInstance = new DisruptionGuaranteeDgApi(defaultClient);
String id = "id_example"; // String | A unique identifier for a contract
List<DgItinerarySlice> dgItinerarySlice = Arrays.asList(); // List<DgItinerarySlice> |
try {
DgContract result = apiInstance.putDgContractsIdItinerarySlices(id, dgItinerarySlice);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DisruptionGuaranteeDgApi#putDgContractsIdItinerarySlices");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | A unique identifier for a contract | |
| dgItinerarySlice | List<DgItinerarySlice> |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The Updated DG contract | * Expires - * Cache-Control - |
| 204 | The DG Contract Itinerary Slices update request was successfully validated but not performed | * Expires - * Cache-Control - |
| 400 | Syntactic errors were encountered while handling the request | - |
| 401 | The client could not be authenticated | - |
| 403 | The authenticated client does not have permission to call this endpoint | - |
| 404 | The requested resource could not be found | - |
| 422 | Semantic errors were encountered while handling the request | - |
| 500 | The server encountered an internal error | - |
DgContract putDgContractsIdUpdateStatus(id, updateDgContractStatusRequest)
Update DG Contract Status
Update DG Contract Status
// Import classes:
import com.hopper.cloud.airlines.ApiClient;
import com.hopper.cloud.airlines.ApiException;
import com.hopper.cloud.airlines.Configuration;
import com.hopper.cloud.airlines.auth.*;
import com.hopper.cloud.airlines.models.*;
import com.hopper.cloud.airlines.api.DisruptionGuaranteeDgApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://airlines-api.hopper.com/airline/v1.1");
// Configure HTTP bearer authorization: PartnerAuth
HttpBearerAuth PartnerAuth = (HttpBearerAuth) defaultClient.getAuthentication("PartnerAuth");
PartnerAuth.setBearerToken("BEARER TOKEN");
DisruptionGuaranteeDgApi apiInstance = new DisruptionGuaranteeDgApi(defaultClient);
String id = "id_example"; // String | A unique identifier for a contract
UpdateDgContractStatusRequest updateDgContractStatusRequest = new UpdateDgContractStatusRequest(); // UpdateDgContractStatusRequest |
try {
DgContract result = apiInstance.putDgContractsIdUpdateStatus(id, updateDgContractStatusRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DisruptionGuaranteeDgApi#putDgContractsIdUpdateStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | A unique identifier for a contract | |
| updateDgContractStatusRequest | UpdateDgContractStatusRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | The Updated DG contract | * Expires - * Cache-Control - |
| 204 | The DG contract status update request was successfully validated but not performed | * Expires - * Cache-Control - |
| 400 | Syntactic errors were encountered while handling the request | - |
| 401 | The client could not be authenticated | - |
| 403 | The authenticated client does not have permission to call this endpoint | - |
| 404 | The requested resource could not be found | - |
| 422 | Semantic errors were encountered while handling the request | - |
| 500 | The server encountered an internal error | - |