diff --git a/release/fraudPreventionV2/client.py b/release/fraudPreventionV2/client.py index be9d7076..73e62cd1 100644 --- a/release/fraudPreventionV2/client.py +++ b/release/fraudPreventionV2/client.py @@ -19,26 +19,53 @@ from uuid import UUID, uuid4 from furl import furl -from openworld.sdk.core.client.api import ApiClient -from openworld.sdk.core.client.openworld_auth_client import _OpenWorldAuthClient -from openworld.sdk.core.configuration.client_config import ClientConfig -from openworld.sdk.core.constant import header + +from expediagroup.sdk.core.client.api import ApiClient +from expediagroup.sdk.core.client.expediagroup_auth_client import ( + _ExpediaGroupAuthClient, +) +from expediagroup.sdk.core.configuration.client_config import ClientConfig +from expediagroup.sdk.core.constant import header from .model import ( + AccountScreenRequest, + AccountScreenResponse, + AccountTakeoverBadRequestError, + AccountTakeoverBadRequestErrorDeserializationContract, + AccountTakeoverUnauthorizedError, + AccountTakeoverUnauthorizedErrorDeserializationContract, + AccountUpdateNotFoundError, + AccountUpdateNotFoundErrorDeserializationContract, + AccountUpdateRequest, + AccountUpdateResponse, BadGatewayError, + BadGatewayErrorDeserializationContract, BadRequestError, + BadRequestErrorDeserializationContract, ForbiddenError, + ForbiddenErrorDeserializationContract, GatewayTimeoutError, + GatewayTimeoutErrorDeserializationContract, InternalServerError, + InternalServerErrorDeserializationContract, NotFoundError, + NotFoundErrorDeserializationContract, OrderPurchaseScreenRequest, OrderPurchaseScreenResponse, OrderPurchaseUpdateNotFoundError, + OrderPurchaseUpdateNotFoundErrorDeserializationContract, OrderPurchaseUpdateRequest, OrderPurchaseUpdateResponse, + RetryableOrderPurchaseScreenFailure, + RetryableOrderPurchaseScreenFailureDeserializationContract, + RetryableOrderPurchaseUpdateFailure, + RetryableOrderPurchaseUpdateFailureDeserializationContract, ServiceUnavailableError, + ServiceUnavailableErrorDeserializationContract, TooManyRequestsError, + TooManyRequestsErrorDeserializationContract, UnauthorizedError, + UnauthorizedErrorDeserializationContract, ) @@ -51,13 +78,136 @@ def __init__(self, client_config: ClientConfig): """ python_version = platform.python_version() os_name, os_version, *_ = platform.platform().split("-") - sdk_metadata = "open-world-sdk-python-fraudpreventionv2/1.4.0" + sdk_metadata = "expediagroup-fraudpreventionv2-python-sdk/2.1.0" - self.__api_client = ApiClient(client_config, _OpenWorldAuthClient) + self.__api_client = ApiClient(client_config, _ExpediaGroupAuthClient) self.__user_agent = f"{sdk_metadata} (Python {python_version}; {os_name} {os_version})" - def screen( + def screen_account( + self, transaction_id: UUID = uuid4(), body: AccountScreenRequest = None + ) -> Union[ + AccountScreenResponse, + AccountTakeoverBadRequestError, + AccountTakeoverUnauthorizedError, + ForbiddenError, + NotFoundError, + TooManyRequestsError, + InternalServerError, + BadGatewayError, + ServiceUnavailableError, + GatewayTimeoutError, + ]: + r"""The Account Screen API gives a Fraud recommendation for an account transaction. A recommendation can be ACCEPT, CHALLENGE, or REJECT. A transaction is marked as CHALLENGE whenever there are insufficient signals to recommend ACCEPT or REJECT. These CHALLENGE incidents are manually reviewed, and a corrected recommendation is made asynchronously. + Args: + body(AccountScreenRequest): ...""" + headers = { + header.TRANSACTION_ID: transaction_id, + header.USER_AGENT: self.__user_agent, + } + + query = {key: value for key, value in {}.items() if value} + + request_url = furl(self.__api_client.endpoint) + request_url /= "/fraud-prevention/v2/account/screen" + request_url.query.set(query) + request_url.path.normalize() + + error_responses = { + 400: AccountTakeoverBadRequestErrorDeserializationContract, + 401: AccountTakeoverUnauthorizedErrorDeserializationContract, + 403: ForbiddenErrorDeserializationContract, + 404: NotFoundErrorDeserializationContract, + 429: TooManyRequestsErrorDeserializationContract, + 500: InternalServerErrorDeserializationContract, + 502: BadGatewayErrorDeserializationContract, + 503: ServiceUnavailableErrorDeserializationContract, + 504: GatewayTimeoutErrorDeserializationContract, + } + + return self.__api_client.call( + headers=headers, + method="post", + body=body, + response_models=[ + AccountScreenResponse, + AccountTakeoverBadRequestError, + AccountTakeoverUnauthorizedError, + ForbiddenError, + NotFoundError, + TooManyRequestsError, + InternalServerError, + BadGatewayError, + ServiceUnavailableError, + GatewayTimeoutError, + ], + url=request_url, + error_responses=error_responses, + ) + + def notify_with_account_update( + self, transaction_id: UUID = uuid4(), body: AccountUpdateRequest = None + ) -> Union[ + AccountUpdateResponse, + AccountTakeoverBadRequestError, + AccountTakeoverUnauthorizedError, + ForbiddenError, + AccountUpdateNotFoundError, + TooManyRequestsError, + InternalServerError, + BadGatewayError, + ServiceUnavailableError, + GatewayTimeoutError, + ]: + r"""The Account Update API is called when there is an account lifecycle transition such as a challenge outcome, account restoration, or remediation action completion. For example, if a user's account is disabled, deleted, or restored, the Account Update API is called to notify Expedia Group about the change. The Account Update API is also called when a user responds to a login Multi-Factor Authentication based on a Fraud recommendation. + Args: + body(AccountUpdateRequest): An AccountUpdate request may be of one of the following types `MULTI_FACTOR_AUTHENTICATION_UPDATE`, `REMEDIATION_UPDATE`. + """ + headers = { + header.TRANSACTION_ID: transaction_id, + header.USER_AGENT: self.__user_agent, + } + + query = {key: value for key, value in {}.items() if value} + + request_url = furl(self.__api_client.endpoint) + request_url /= "/fraud-prevention/v2/account/update" + request_url.query.set(query) + request_url.path.normalize() + + error_responses = { + 400: AccountTakeoverBadRequestErrorDeserializationContract, + 401: AccountTakeoverUnauthorizedErrorDeserializationContract, + 403: ForbiddenErrorDeserializationContract, + 404: AccountUpdateNotFoundErrorDeserializationContract, + 429: TooManyRequestsErrorDeserializationContract, + 500: InternalServerErrorDeserializationContract, + 502: BadGatewayErrorDeserializationContract, + 503: ServiceUnavailableErrorDeserializationContract, + 504: GatewayTimeoutErrorDeserializationContract, + } + + return self.__api_client.call( + headers=headers, + method="post", + body=body, + response_models=[ + AccountUpdateResponse, + AccountTakeoverBadRequestError, + AccountTakeoverUnauthorizedError, + ForbiddenError, + AccountUpdateNotFoundError, + TooManyRequestsError, + InternalServerError, + BadGatewayError, + ServiceUnavailableError, + GatewayTimeoutError, + ], + url=request_url, + error_responses=error_responses, + ) + + def screen_order( self, transaction_id: UUID = uuid4(), body: OrderPurchaseScreenRequest = None ) -> Union[ OrderPurchaseScreenResponse, @@ -68,7 +218,7 @@ def screen( TooManyRequestsError, InternalServerError, BadGatewayError, - ServiceUnavailableError, + RetryableOrderPurchaseScreenFailure, GatewayTimeoutError, ]: r"""The Order Purchase API gives a Fraud recommendation for a transaction. A recommendation can be Accept, Reject, or Review. A transaction is marked as Review whenever there are insufficient signals to recommend Accept or Reject. These incidents are manually reviewed, and a corrected recommendation is made asynchronously. @@ -86,6 +236,18 @@ def screen( request_url.query.set(query) request_url.path.normalize() + error_responses = { + 400: BadRequestErrorDeserializationContract, + 401: UnauthorizedErrorDeserializationContract, + 403: ForbiddenErrorDeserializationContract, + 404: NotFoundErrorDeserializationContract, + 429: TooManyRequestsErrorDeserializationContract, + 500: InternalServerErrorDeserializationContract, + 502: BadGatewayErrorDeserializationContract, + 503: RetryableOrderPurchaseScreenFailureDeserializationContract, + 504: GatewayTimeoutErrorDeserializationContract, + } + return self.__api_client.call( headers=headers, method="post", @@ -99,13 +261,14 @@ def screen( TooManyRequestsError, InternalServerError, BadGatewayError, - ServiceUnavailableError, + RetryableOrderPurchaseScreenFailure, GatewayTimeoutError, ], url=request_url, + error_responses=error_responses, ) - def update( + def notify_with_order_update( self, transaction_id: UUID = uuid4(), body: OrderPurchaseUpdateRequest = None ) -> Union[ OrderPurchaseUpdateResponse, @@ -116,7 +279,7 @@ def update( TooManyRequestsError, InternalServerError, BadGatewayError, - ServiceUnavailableError, + RetryableOrderPurchaseUpdateFailure, GatewayTimeoutError, ]: r"""The Order Purchase Update API is called when the status of the order has changed. @@ -140,6 +303,18 @@ def update( request_url.query.set(query) request_url.path.normalize() + error_responses = { + 400: BadRequestErrorDeserializationContract, + 401: UnauthorizedErrorDeserializationContract, + 403: ForbiddenErrorDeserializationContract, + 404: OrderPurchaseUpdateNotFoundErrorDeserializationContract, + 429: TooManyRequestsErrorDeserializationContract, + 500: InternalServerErrorDeserializationContract, + 502: BadGatewayErrorDeserializationContract, + 503: RetryableOrderPurchaseUpdateFailureDeserializationContract, + 504: GatewayTimeoutErrorDeserializationContract, + } + return self.__api_client.call( headers=headers, method="post", @@ -153,8 +328,9 @@ def update( TooManyRequestsError, InternalServerError, BadGatewayError, - ServiceUnavailableError, + RetryableOrderPurchaseUpdateFailure, GatewayTimeoutError, ], url=request_url, + error_responses=error_responses, ) diff --git a/release/fraudPreventionV2/model.py b/release/fraudPreventionV2/model.py index b564646b..1e52637c 100644 --- a/release/fraudPreventionV2/model.py +++ b/release/fraudPreventionV2/model.py @@ -18,27 +18,16 @@ from enum import Enum from typing import Any, Literal, Optional, Union -from pydantic import BaseModel, EmailStr, Extra, Field, confloat, conint, constr +from pydantic import BaseModel, EmailStr, Extra, Field, constr +from pydantic.dataclasses import dataclass + +from expediagroup.sdk.core.model.exception.service import ExpediaGroupApiException class Code( Enum, ): - r"""pydantic model Code: Snake cased all caps error code interpreted from the HTTP status code that can programmatically be acted upon. - Attributes: - UNAUTHORIZED(Any): -- - FORBIDDEN(Any): -- - NOT_FOUND(Any): -- - ORDER_PURCHASE_UPDATE_NOT_FOUND(Any): -- - TOO_MANY_REQUESTS(Any): -- - INTERNAL_SERVER_ERROR(Any): -- - BAD_GATEWAY(Any): -- - RETRYABLE_ORDER_PURCHASE_SCREEN_FAILURE(Any): -- - RETRYABLE_ORDER_PURCHASE_UPDATE_FAILURE(Any): -- - GATEWAY_TIMEOUT(Any): -- - BAD_REQUEST(Any): -- - - """ + r"""pydantic model Code: Snake cased all caps error code interpreted from the HTTP status code that can programmatically be acted upon.""" UNAUTHORIZED: Any = "UNAUTHORIZED" FORBIDDEN: Any = "FORBIDDEN" NOT_FOUND: Any = "NOT_FOUND" @@ -57,12 +46,7 @@ class Error( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Error: The object used to describe an error, containing both human-readable and machine-readable information. - Attributes: - code(Code): Snake cased all caps error code interpreted from the HTTP status code that can programmatically be acted upon. - message(str): A human-readable explanation of the error, specific to this error occurrence. - - """ + r"""pydantic model Error: The object used to describe an error, containing both human-readable and machine-readable information.""" code: Code = Field(..., example="BAD_REQUEST") """ Snake cased all caps error code interpreted from the HTTP status code that can programmatically be acted upon. @@ -82,24 +66,6 @@ class UnauthorizedError( pass -class ForbiddenError( - Error, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model ForbiddenError: Indicates that the API cannot fulfill the request because while the client is correctly authenticated, the client doesn't have the permission to execute the specified operation. This error type does not imply that the request is valid, or that the resource against which the operation being performed exists or satisfies other pre-conditions.""" - pass - - -class NotFoundError( - Error, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model NotFoundError: Indicates that the API cannot find the resource that is either being requested or against which the operation is being performed. Please check the request again to make sure that the request is valid.""" - pass - - class OrderPurchaseUpdateNotFoundError( Error, smart_union=True, @@ -109,65 +75,34 @@ class OrderPurchaseUpdateNotFoundError( pass -class TooManyRequestsError( - Error, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model TooManyRequestsError: Indicates that the API cannot fulfill the request because server resources have been exhausted. Perhaps the client has sent too many requests in a given amount of time or has reached some specific quota. Please check the rate limits for the product and adjust as necessary before retries. If you believe the rate limit was incorrect or if you need a different rate limit, please reach out to the regarding the next steps.""" - pass - - -class InternalServerError( +class RetryableOrderPurchaseScreenFailure( Error, smart_union=True, extra=Extra.forbid, ): - r"""pydantic model InternalServerError: Indicates that the API encountered an unexpected condition that prevented it from fulfilling the request. Sometimes used as a generic catch-allerror type when no other error types can be used. Retrying the same request will usually result in the same error. Please reach out to support team as next step for this error resolution.""" - pass - + r"""pydantic model RetryableOrderPurchaseScreenFailure: Indicates that the API is either down for maintenance or overloaded and cannot fulfill the request at the current time. This is a temporary error and retrying the same request after a certain delay could eventually result in success. + There will be a Retry-After HTTP header in API response specifying how long to wait to retry the request. If there is no Retry-After HTTP header then retry can happen immediately. If the error persists after retrying with delay, please reach out to ." -class BadGatewayError( - Error, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model BadGatewayError: Indicates that the server received an invalid response from the upstream server. Causes could be incorrectly configured target server at gateway, EOF exception, incorrectly configured keep-alive timeouts. Please reach out to support team as next step for this error resolution.""" + """ pass -class ServiceUnavailableError( +class RetryableOrderPurchaseUpdateFailure( Error, smart_union=True, extra=Extra.forbid, ): - r"""pydantic model ServiceUnavailableError: Indicates that the API is either down for maintenance or overloaded and cannot fulfill the request at the current time. This is a temporary error and retrying the same request after a certain delay could eventually result in success. + r"""pydantic model RetryableOrderPurchaseUpdateFailure: Indicates that the API is either down for maintenance or overloaded and cannot fulfill the request at the current time. This is a temporary error and retrying the same request after a certain delay could eventually result in success. There will be a Retry-After HTTP header in API response specifying how long to wait to retry the request. If there is no Retry-After HTTP header then retry can happen immediately. If the error persists after retrying with delay, please reach out to ." - """ pass -class GatewayTimeoutError( - Error, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model GatewayTimeoutError: Indicates that the API gateway has issues completing the request on time. Request can be retried if it is idempotent, If the issue persists, please reach out to support. For non-idempotent requests, please reach out to to know the status of your request before attempting retries.""" - pass - - class Code1( Enum, ): - r"""pydantic model Code1 - Attributes: - MISSING_MANDATORY_PARAM(Any): -- - INVALID_PARAM(Any): -- - INVALID_FORMAT(Any): -- - - """ + r"""pydantic model Code1""" MISSING_MANDATORY_PARAM: Any = "MISSING_MANDATORY_PARAM" INVALID_PARAM: Any = "INVALID_PARAM" INVALID_FORMAT: Any = "INVALID_FORMAT" @@ -178,19 +113,13 @@ class Cause( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Cause - Attributes: - code(Optional[Code1], optional): -- - field(Optional[str], optional): A JSON Path expression indicating which field, in the request body, caused the error. - message(Optional[str], optional): -- - - """ + r"""pydantic model Cause""" code: Optional[Code1] = Field(None, example="MISSING_MANDATORY_PARAM") - field: Optional[str] = Field(None, example="$.transaction.payments.brand") + field: Optional[str] = Field(None, example="$.transaction.customer_account.account_type") """ A JSON Path expression indicating which field, in the request body, caused the error. """ - message: Optional[str] = Field(None, example="The value of a field was missed or not valid.") + message: Optional[str] = Field(None, example="The value of a field should not be null.") class BadRequestError( @@ -198,26 +127,14 @@ class BadRequestError( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model BadRequestError: Indicates that a bad request occurred. Typically it is an invalid parameter. - Attributes: - causes(Optional[list[Cause]], optional): -- - - """ + r"""pydantic model BadRequestError: Indicates that a bad request occurred. Typically it is an invalid parameter.""" causes: Optional[list[Cause]] = None class UpdateType( Enum, ): - r"""pydantic model UpdateType: Transaction type associated with the update event. - Attributes: - ORDER_UPDATE(Any): -- - CHARGEBACK_FEEDBACK(Any): -- - INSULT_FEEDBACK(Any): -- - REFUND_UPDATE(Any): -- - PAYMENT_UPDATE(Any): -- - - """ + r"""pydantic model UpdateType: Transaction type associated with the update event.""" ORDER_UPDATE: Any = "ORDER_UPDATE" CHARGEBACK_FEEDBACK: Any = "CHARGEBACK_FEEDBACK" INSULT_FEEDBACK: Any = "INSULT_FEEDBACK" @@ -230,14 +147,7 @@ class CancellationReason( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model CancellationReason: Reason of order update cancellation. - Attributes: - primary_reason_code(Optional[constr(max_length=200)], optional): Primary cancellation reason code. - sub_reason_code(Optional[constr(max_length=200)], optional): Substitute cancellation reason code. - primary_reason_description(Optional[constr(max_length=200)], optional): Primary cancellation reason code. Required if `order_status = CANCELLED`. - sub_reason_description(Optional[constr(max_length=200)], optional): Substitute cancellation reason description. - - """ + r"""pydantic model CancellationReason: Reason of order update cancellation.""" primary_reason_code: Optional[constr(max_length=200)] = None """ Primary cancellation reason code. @@ -263,10 +173,6 @@ class RefundStatus( -`ISSUED` - The refund was issued. -`SETTLED` - The refund was settled. - Attributes: - ISSUED(Any): -- - SETTLED(Any): -- - """ ISSUED: Any = "ISSUED" SETTLED: Any = "SETTLED" @@ -279,10 +185,6 @@ class ChargebackStatus( -`RECEIVED` - The chargeback was received. -`REVERSAL` - The chargeback reversal was received. - Attributes: - RECEIVED(Any): -- - REVERSAL(Any): -- - """ RECEIVED: Any = "RECEIVED" REVERSAL: Any = "REVERSAL" @@ -291,12 +193,7 @@ class ChargebackStatus( class ChargebackReason( Enum, ): - r"""pydantic model ChargebackReason: Reason for chargeback which can be `Fraud` or `Non Fraud`. - Attributes: - FRAUD(Any): -- - NON_FRAUD(Any): -- - - """ + r"""pydantic model ChargebackReason: Reason for chargeback which can be `Fraud` or `Non Fraud`.""" FRAUD: Any = "FRAUD" NON_FRAUD: Any = "NON_FRAUD" @@ -306,14 +203,10 @@ class InsultDetail( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model InsultDetail: Details related to the insult. - Attributes: - insult_reported_date_time(Optional[datetime], optional): Date and time when the insult was reported to the partner, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - - """ + r"""pydantic model InsultDetail: Details related to the insult.""" insult_reported_date_time: Optional[datetime] = None """ - Date and time when the insult was reported to the partner, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Date and time when the insult was reported to the partner, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ @@ -331,13 +224,6 @@ class Status( * `CHANGE_COMPLETED` or `CHANGE_FAILED` are applicable if OrderPurchaseScreen Fraud API was called via a change in order which is through `transaction.transaction_details.order_type` = `CHANGE` * `COMPLETED` or `CANCELLED` order status indicates the completion of lifecycle on an order. - Attributes: - COMPLETED(Any): -- - CHANGE_COMPLETED(Any): -- - CANCELLED(Any): -- - FAILED(Any): -- - CHANGE_FAILED(Any): -- - """ COMPLETED: Any = "COMPLETED" CHANGE_COMPLETED: Any = "CHANGE_COMPLETED" @@ -351,11 +237,7 @@ class OrderPurchaseUpdateResponse( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model OrderPurchaseUpdateResponse - Attributes: - risk_id(Optional[constr(max_length=200)], optional): Unique identifier of transaction that was updated. - - """ + r"""pydantic model OrderPurchaseUpdateResponse""" risk_id: Optional[constr(max_length=200)] = Field(None, example="1234567") """ Unique identifier of transaction that was updated. @@ -365,13 +247,7 @@ class OrderPurchaseUpdateResponse( class FraudDecision( Enum, ): - r"""pydantic model FraudDecision - Attributes: - ACCEPT(Any): -- - REVIEW(Any): -- - REJECT(Any): -- - - """ + r"""pydantic model FraudDecision""" ACCEPT: Any = "ACCEPT" REVIEW: Any = "REVIEW" REJECT: Any = "REJECT" @@ -382,12 +258,7 @@ class SiteInfo( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model SiteInfo - Attributes: - country_code(constr(regex=r'^[A-Z]{3}$')): The alpha-3 ISO code that represents a country name. - agent_assisted(bool): Identifies if an agent assisted in booking travel for the customer. `False` if the order was directly booked by customer. - - """ + r"""pydantic model SiteInfo""" country_code: constr(regex=r"^[A-Z]{3}$") = Field(..., example="USA") """ The alpha-3 ISO code that represents a country name. @@ -403,18 +274,12 @@ class DeviceDetails( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model DeviceDetails - Attributes: - source(Optional[constr(max_length=50)], optional): Source of the device_box. Default value is `TrustWidget`. - device_box(constr(max_length=16000)): Device related information retrieved from TrustWidget. - ip_address(constr(regex=r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$')): IP address of the device used for booking. - - """ + r"""pydantic model DeviceDetails""" source: Optional[constr(max_length=50)] = None """ Source of the device_box. Default value is `TrustWidget`. """ - device_box: constr(max_length=16000) = None + device_box: Optional[constr(max_length=16000)] = None """ Device related information retrieved from TrustWidget. """ @@ -433,10 +298,6 @@ class CurrentOrderStatus( * `IN_PROGRESS` is used when order has not processed fully. For example, inventory has not yet been reserved, or payment has not yet been settled. * `COMPLETED` is used when an order has been processed fully. For example, inventory has been reserved, and the payment has been settled. - Attributes: - IN_PROGRESS(Any): -- - COMPLETED(Any): -- - """ IN_PROGRESS: Any = "IN_PROGRESS" COMPLETED: Any = "COMPLETED" @@ -451,10 +312,6 @@ class OrderType( `CHANGE` - If a `OrderPurchaseScreenRequest` has already been submitted for the initial booking with `order_type = CREATE`, but has now been modified and partner wishes to resubmit for Fraud screening then the `order_type = CHANGE`. Examples of changes that are supported are changes made to `check-in/checkout dates` or `price of a TravelProduct`. - Attributes: - CREATE(Any): -- - CHANGE(Any): -- - """ CREATE: Any = "CREATE" CHANGE: Any = "CHANGE" @@ -469,10 +326,6 @@ class AccountType( -`STANDARD` - Default account type. - Attributes: - GUEST(Any): -- - STANDARD(Any): -- - """ GUEST: Any = "GUEST" STANDARD: Any = "STANDARD" @@ -481,12 +334,7 @@ class AccountType( class AddressType( Enum, ): - r"""pydantic model AddressType - Attributes: - HOME(Any): -- - WORK(Any): -- - - """ + r"""pydantic model AddressType""" HOME: Any = "HOME" WORK: Any = "WORK" @@ -496,17 +344,7 @@ class Address( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Address - Attributes: - address_type(Optional[AddressType], optional): -- - address_line1(Optional[constr(max_length=200)], optional): Address line 1 of the address provided. - address_line2(Optional[constr(max_length=200)], optional): Address line 2 of the address provided. - city(Optional[constr(max_length=200)], optional): City of the address provided. - state(Optional[constr(regex=r'^[A-Z]{2}$')], optional): The two-characters ISO code for the state or province of the address. - zip_code(Optional[constr(max_length=20)], optional): Zip code of the address provided. - country_code(Optional[constr(regex=r'^[A-Z]{3}$')], optional): ISO alpha-3 country code of the address provided. - - """ + r"""pydantic model Address""" address_type: Optional[AddressType] = None address_line1: Optional[constr(max_length=200)] = None """ @@ -541,10 +379,6 @@ class InventorySource( * `MERCHANT` is used when Partner is the merchant of record for this order. * `AGENCY` is used when this order is through an agency booking. - Attributes: - MERCHANT(Any): -- - AGENCY(Any): -- - """ MERCHANT: Any = "MERCHANT" AGENCY: Any = "AGENCY" @@ -555,11 +389,7 @@ class TravelersReference( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model TravelersReference - Attributes: - __root__(constr(max_length=50)): -- - - """ + r"""pydantic model TravelersReference""" __root__: constr(max_length=50) = None @@ -571,11 +401,6 @@ class RouteType( - `ONE_WAY` - The Rail product represents a one-way journey. - `ROUNDTRIP` - The Rail product represents a roundtrip journey. - Attributes: - MULTIPLE_DESTINATIONS(Any): -- - ONE_WAY(Any): -- - ROUND_TRIP(Any): -- - """ MULTIPLE_DESTINATIONS: Any = "MULTIPLE_DESTINATIONS" ONE_WAY: Any = "ONE_WAY" @@ -586,22 +411,13 @@ class TransportationMethod( Enum, ): r"""pydantic model TransportationMethod: This attribute represents the specific transportation method by which the passenger is traveling. It captures the mode of transportation used during the Rail product journey, Possible values are: - - `BUS` - The Rail product includes bus transportation for certain segments of the itinerary. - - `FERRY` - The Rail product involves ferry transportation as part of the journey. - - `PUBLIC_TRANSPORT` - The Rail product represents the use of public transportation modes for the journey. - - `TRAM` - The Rail product includes tram transportation as part of the journey. - - `RAIL` - The Rail product specifically utilizes train transportation for the journey. - - `TRANSFER` - The Rail product involves transfers between different modes of transportation. - - `OTHER` - The Rail product utilizes transportation methods not covered by the aforementioned categories. - - Attributes: - BUS(Any): -- - FERRY(Any): -- - PUBLIC_TRANSPORT(Any): -- - RAIL(Any): -- - TRAM(Any): -- - TRANSFER(Any): -- - OTHERS(Any): -- + - `BUS` - The Rail product includes bus transportation for certain segments of the itinerary. + - `FERRY` - The Rail product involves ferry transportation as part of the journey. + - `PUBLIC_TRANSPORT` - The Rail product represents the use of public transportation modes for the journey. + - `TRAM` - The Rail product includes tram transportation as part of the journey. + - `RAIL` - The Rail product specifically utilizes train transportation for the journey. + - `TRANSFER` - The Rail product involves transfers between different modes of transportation. + - `OTHER` - The Rail product utilizes transportation methods not covered by the aforementioned categories. """ BUS: Any = "BUS" @@ -618,11 +434,7 @@ class OperatingCompany( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model OperatingCompany: This attribute captures the name or identifier of the company responsible for operating the Rail product. It represents the specific operating entity, such as Amtrak, British Railways, or a bus company. - Attributes: - marketing_name(Optional[constr(max_length=200)], optional): The name used by the transportation carrier for marketing purposes in the travel segment. Example: ARX, AMTRAC, ARRIVA - - """ + r"""pydantic model OperatingCompany: This attribute captures the name or identifier of the company responsible for operating the Rail product. It represents the specific operating entity, such as Amtrak, British Railways, or a bus company.""" marketing_name: Optional[constr(max_length=200)] = None """ The name used by the transportation carrier for marketing purposes in the travel segment. Example: ARX, AMTRAC, ARRIVA @@ -632,12 +444,7 @@ class OperatingCompany( class Type( Enum, ): - r"""pydantic model Type: This attribute provides information about the specific classification assigned to the rail station. It helps differentiate between different types of stations, such as major stations (STATION) or stations located within a city (city). - Attributes: - STATION(Any): -- - CITY(Any): -- - - """ + r"""pydantic model Type: This attribute provides information about the specific classification assigned to the rail station. It helps differentiate between different types of stations, such as major stations (STATION) or stations located within a city (city).""" STATION: Any = "STATION" CITY: Any = "CITY" @@ -647,15 +454,7 @@ class RailwayStationDetails( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model RailwayStationDetails - Attributes: - name(constr(max_length=200)): The popularly known name or title by which the railway station is identified. - type(Optional[Type], optional): This attribute provides information about the specific classification assigned to the rail station. It helps differentiate between different types of stations, such as major stations (STATION) or stations located within a city (city). - station_code(constr(max_length=200)): The unique identifier or code assigned to an individual rail station or a pseudo-station representing all the stations within a specific city, from which rail travel originates. - address(Address): -- - timezone(Optional[constr(max_length=200)], optional): The timezone associated with the location of the station, specifying the local time offset from Coordinated Universal Time (UTC). - - """ + r"""pydantic model RailwayStationDetails""" name: constr(max_length=200) = Field(..., example="Grand Central Terminal") """ The popularly known name or title by which the railway station is identified. @@ -675,132 +474,10 @@ class RailwayStationDetails( """ -class Activity( - BaseModel, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model Activity: Provides essential details about a specific activity. - Attributes: - type(constr(max_length=200)): This field provides a categorization of the different types of activities available within the activity product. It is designed to accommodate the preferences of the API consumer, allowing them to assign a descriptive label or keyword that accurately represents the nature of each activity. Here are some suggested values for this field: | Adventures: This category includes activities such as hiking, zip-lining, rock climbing, bungee jumping, and other adventurous pursuits. | Air, Balloon & Helicopter Tours: This category offers activities like hot air balloon rides, helicopter tours, and aerial sightseeing experiences. | Cruises & Water Tours: This includes options such as boat cruises, yacht tours, river rafting, snorkeling, and diving expeditions. | Nightlife: This category encompasses activities like clubbing, pub crawls, live music events, and cultural performances. These activities predominantly occur during the evening or nighttime. - description(constr(max_length=200)): This field within the trip information provides additional details or a brief explanation about the specific trip or activity being described - - """ - type: constr(max_length=200) = Field(..., example="Balloon & Helicopter Tours") - """ - This field provides a categorization of the different types of activities available within the activity product. It is designed to accommodate the preferences of the API consumer, allowing them to assign a descriptive label or keyword that accurately represents the nature of each activity. Here are some suggested values for this field: | Adventures: This category includes activities such as hiking, zip-lining, rock climbing, bungee jumping, and other adventurous pursuits. | Air, Balloon & Helicopter Tours: This category offers activities like hot air balloon rides, helicopter tours, and aerial sightseeing experiences. | Cruises & Water Tours: This includes options such as boat cruises, yacht tours, river rafting, snorkeling, and diving expeditions. | Nightlife: This category encompasses activities like clubbing, pub crawls, live music events, and cultural performances. These activities predominantly occur during the evening or nighttime. - """ - description: constr(max_length=200) = Field(..., example="2-Day, 2 Day Ticket Weekend") - """ - This field within the trip information provides additional details or a brief explanation about the specific trip or activity being described - """ - - -class Coordinates( - BaseModel, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model Coordinates: Group of attributes intended to hold information about location coordinates. - Attributes: - latitude(Optional[confloat(ge=-90.0, le=90.0)], optional): The latitude in degrees. It must be in the range [-90.0, +90.0]. - longitude(Optional[confloat(ge=-180.0, le=180.0)], optional): The longitude in degrees. It must be in the range [-180.0, +180.0]. - - """ - latitude: Optional[confloat(ge=-90.0, le=90.0)] = None - """ - The latitude in degrees. It must be in the range [-90.0, +90.0]. - """ - longitude: Optional[confloat(ge=-180.0, le=180.0)] = None - """ - The longitude in degrees. It must be in the range [-180.0, +180.0]. - """ - - -class Type1( - Enum, -): - r"""pydantic model Type1: This field indicates the nature or relationship of the vendor associated with a particular activity. | THIRD_PARTY: This value indicates that the vendor is an external entity or third-party provider. | DIRECT: This value signifies that the vendor is a direct entity or provider associated with the organization or platform offering the activity. - Attributes: - THIRD_PARTY(Any): -- - DIRECT(Any): -- - - """ - THIRD_PARTY: Any = "THIRD_PARTY" - DIRECT: Any = "DIRECT" - - -class OperatingCompanyModel( - BaseModel, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model OperatingCompanyModel: This field helps to identify and understand the specific provider or operating company involved in offering the activity. - Attributes: - name(str): This field includes the provider's name. - type(Type1): This field indicates the nature or relationship of the vendor associated with a particular activity. | THIRD_PARTY: This value indicates that the vendor is an external entity or third-party provider. | DIRECT: This value signifies that the vendor is a direct entity or provider associated with the organization or platform offering the activity. - - """ - name: str = Field(..., example="VIATOR") - """ - This field includes the provider's name. - """ - type: Type1 = None - """ - This field indicates the nature or relationship of the vendor associated with a particular activity. | THIRD_PARTY: This value indicates that the vendor is an external entity or third-party provider. | DIRECT: This value signifies that the vendor is a direct entity or provider associated with the organization or platform offering the activity. - """ - - -class Category( - Enum, -): - r"""pydantic model Category: Describes the type or category of the ticket. - Attributes: - ADULT(Any): -- - CHILD(Any): -- - SENIOR(Any): -- - STUDENT(Any): -- - OTHER(Any): -- - - """ - ADULT: Any = "ADULT" - CHILD: Any = "CHILD" - SENIOR: Any = "SENIOR" - STUDENT: Any = "STUDENT" - OTHER: Any = "OTHER" - - -class Ticket( - BaseModel, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model Ticket: This field provides information about the tickets related to the activity. - Attributes: - category(Category): Describes the type or category of the ticket. - quantity(conint(ge=1, le=30)): This field represents the count or number of a specific ticket type associated with an activity. - - """ - category: Category = None - """ - Describes the type or category of the ticket. - """ - quantity: conint(ge=1, le=30) = None - """ - This field represents the count or number of a specific ticket type associated with an activity. - """ - - class FlightType( Enum, ): - r"""pydantic model FlightType: Identifies the type of air trip based on the air destinations. - Attributes: - ROUNDTRIP(Any): -- - ONEWAY(Any): -- - MULTIPLE_DESTINATION(Any): -- - - """ + r"""pydantic model FlightType: Identifies the type of air trip based on the air destinations.""" ROUNDTRIP: Any = "ROUNDTRIP" ONEWAY: Any = "ONEWAY" MULTIPLE_DESTINATION: Any = "MULTIPLE_DESTINATION" @@ -811,15 +488,7 @@ class AirSegment( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model AirSegment - Attributes: - airline_code(constr(max_length=10)): Airline code of the trip segment - departure_airport_code(constr(max_length=10)): Departure airport of the trip segment - arrival_airport_code(constr(max_length=10)): Arrival airport of the trip segment - departure_time(Optional[datetime], optional): Local date and time of departure from departure location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - arrival_time(Optional[datetime], optional): Local date and time of arrival to destination location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - - """ + r"""pydantic model AirSegment""" airline_code: constr(max_length=10) = None """ Airline code of the trip segment @@ -834,11 +503,11 @@ class AirSegment( """ departure_time: Optional[datetime] = None """ - Local date and time of departure from departure location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time of departure from departure location, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ arrival_time: Optional[datetime] = None """ - Local date and time of arrival to destination location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time of arrival to destination location, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ @@ -921,55 +590,6 @@ class Brand( * `ELV` * `INTER_COMPANY` - Attributes: - AMERICAN_EXPRESS(Any): -- - DINERS_CLUB_INTERNATIONAL(Any): -- - BC_CARD(Any): -- - DISCOVER(Any): -- - JCB(Any): -- - MASTER_CARD(Any): -- - MAESTRO(Any): -- - POSTEPAY_MASTERCARD(Any): -- - SOLO(Any): -- - SWITCH(Any): -- - CHINA_UNION_PAY(Any): -- - VISA(Any): -- - VISA_DELTA(Any): -- - VISA_ELECTRON(Any): -- - CARTA_SI(Any): -- - CARTE_BLEUE(Any): -- - VISA_DANKORT(Any): -- - POSTEPAY_VISA_ELECTRON(Any): -- - PAYPAL(Any): -- - EXPEDIA_REWARDS(Any): -- - AMEX_POINTS(Any): -- - BANK_OF_AMERICA_REWARDS(Any): -- - DISCOVER_POINTS(Any): -- - MASTER_CARD_POINTS(Any): -- - CITI_THANK_YOU_POINTS(Any): -- - MERRILL_LYNCH_REWARDS(Any): -- - WELLS_FARGO_POINTS(Any): -- - DELTA_SKY_MILES(Any): -- - UNITED_POINTS(Any): -- - DISCOVER_MILES(Any): -- - ALASKA_MILES(Any): -- - RBC_REWARDS(Any): -- - BILT_REWARDS(Any): -- - ORBUCKS(Any): -- - CHEAP_CASH(Any): -- - BONUS_PLUS(Any): -- - ULTIMATE_REWARDS(Any): -- - GIFT_CARD(Any): -- - IBP(Any): -- - LOCAL_DEBIT_CARD(Any): -- - SOFORT(Any): -- - YANDEX(Any): -- - WEB_MONEY(Any): -- - QIWI(Any): -- - BITCOIN(Any): -- - ELV(Any): -- - INTER_COMPANY(Any): -- - """ AMERICAN_EXPRESS: Any = "AMERICAN_EXPRESS" DINERS_CLUB_INTERNATIONAL: Any = "DINERS_CLUB_INTERNATIONAL" @@ -1025,12 +645,7 @@ class PaymentThreeDSCriteria( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model PaymentThreeDSCriteria: Payment ThreeDS criteria attributes. - Attributes: - probable_flag(Optional[bool], optional): This is a flag passed that indicates that this transaction could potentially go through 3DS. - transaction_model(Optional[constr(max_length=200)], optional): Model used to process payment transaction. - - """ + r"""pydantic model PaymentThreeDSCriteria: Payment ThreeDS criteria attributes.""" probable_flag: Optional[bool] = None """ This is a flag passed that indicates that this transaction could potentially go through 3DS. @@ -1051,13 +666,6 @@ class PaymentReason( - `SUBSEQUENT` - An additional amount paid that was not originally scheduled. - `DEFERRED` - Attributes: - FULL(Any): -- - DEPOSIT(Any): -- - SCHEDULED(Any): -- - SUBSEQUENT(Any): -- - DEFERRED(Any): -- - """ FULL: Any = "FULL" DEPOSIT: Any = "DEPOSIT" @@ -1069,12 +677,7 @@ class PaymentReason( class VerificationType( Enum, ): - r"""pydantic model VerificationType: The type of the verification used to verify the instrument. If the Card Verfication Value was provided to verify the credit card used for the transaction, `type = CVV`. - Attributes: - CVV(Any): -- - field_3DS(Any): -- - - """ + r"""pydantic model VerificationType: The type of the verification used to verify the instrument. If the Card Verfication Value was provided to verify the credit card used for the transaction, `type = CVV`.""" CVV: Any = "CVV" field_3DS: Any = "3DS" @@ -1082,12 +685,7 @@ class VerificationType( class PaymentStatus( Enum, ): - r"""pydantic model PaymentStatus: The status of the payment operation. - Attributes: - COMPLETED(Any): -- - FAILED(Any): -- - - """ + r"""pydantic model PaymentStatus: The status of the payment operation.""" COMPLETED: Any = "COMPLETED" FAILED: Any = "FAILED" @@ -1095,16 +693,7 @@ class PaymentStatus( class PaymentMethod( Enum, ): - r"""pydantic model PaymentMethod: The payment method used at the time of purchase for the transaction. Supported `method`'s are: `CREDIT_CARD`, `PAYPAL`, `POINTS`, `GIFT_CARD`, `INTERNET_BANK_PAYMENT`, `DIRECT_DEBIT`. - Attributes: - CREDIT_CARD(Any): -- - PAYPAL(Any): -- - POINTS(Any): -- - GIFT_CARD(Any): -- - INTERNET_BANK_PAYMENT(Any): -- - DIRECT_DEBIT(Any): -- - - """ + r"""pydantic model PaymentMethod: The payment method used at the time of purchase for the transaction. Supported `method`'s are: `CREDIT_CARD`, `PAYPAL`, `POINTS`, `GIFT_CARD`, `INTERNET_BANK_PAYMENT`, `DIRECT_DEBIT`.""" CREDIT_CARD: Any = "CREDIT_CARD" PAYPAL: Any = "PAYPAL" POINTS: Any = "POINTS" @@ -1116,24 +705,13 @@ class PaymentMethod( class TravelProductType( Enum, ): - r"""pydantic model TravelProductType: Type of product. - Attributes: - CRUISE(Any): -- - AIR(Any): -- - CAR(Any): -- - INSURANCE(Any): -- - HOTEL(Any): -- - RAIL(Any): -- - ACTIVITIES(Any): -- - - """ + r"""pydantic model TravelProductType: Type of product.""" CRUISE: Any = "CRUISE" AIR: Any = "AIR" CAR: Any = "CAR" INSURANCE: Any = "INSURANCE" HOTEL: Any = "HOTEL" RAIL: Any = "RAIL" - ACTIVITIES: Any = "ACTIVITIES" class CardType( @@ -1169,18 +747,6 @@ class CardType( * `VISA` : `VISA_DANKORT` * `VISA` : `POSTEPAY_VISA_ELECTRON` - Attributes: - AMERICAN_EXPRESS(Any): -- - DINERS_CLUB(Any): -- - DISCOVER(Any): -- - JCB(Any): -- - MASTER_CARD(Any): -- - SOLO(Any): -- - SWITCH(Any): -- - MAESTRO(Any): -- - CHINA_UNION_PAY(Any): -- - VISA(Any): -- - """ AMERICAN_EXPRESS: Any = "AMERICAN_EXPRESS" DINERS_CLUB: Any = "DINERS_CLUB" @@ -1199,15 +765,7 @@ class Name( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Name: Group of attributes intended to hold information about a customer or traveler's name for the order. - Attributes: - last_name(constr(max_length=200)): Surname, or last name, of the person. - first_name(constr(max_length=200)): Given, or first name, of the person. - middle_name(Optional[constr(max_length=200)], optional): Middle name of the person. - title(Optional[constr(max_length=200)], optional): Title of the person for name (e.g. Mr., Ms. etc). - suffix(Optional[constr(max_length=50)], optional): Generational designations (e.g. Sr, Jr, III) or values that indicate the individual holds a position, educational degree, accreditation, office, or honor (e.g. PhD, CCNA, OBE). - - """ + r"""pydantic model Name: Group of attributes intended to hold information about a customer or traveler's name for the order.""" last_name: constr(max_length=200) = None """ Surname, or last name, of the person. @@ -1233,15 +791,7 @@ class Name( class TelephoneType( Enum, ): - r"""pydantic model TelephoneType: Classification of the phone (e.g. `Home`, `Mobile`). - Attributes: - HOME(Any): -- - MOBILE(Any): -- - BUSINESS(Any): -- - FAX(Any): -- - OTHER(Any): -- - - """ + r"""pydantic model TelephoneType: Classification of the phone (e.g. `Home`, `Mobile`).""" HOME: Any = "HOME" MOBILE: Any = "MOBILE" BUSINESS: Any = "BUSINESS" @@ -1252,13 +802,7 @@ class TelephoneType( class TelephonePlatformType( Enum, ): - r"""pydantic model TelephonePlatformType: Classification of the phone platform. - Attributes: - MOBILE(Any): -- - LANDLINE(Any): -- - VOIP(Any): -- - - """ + r"""pydantic model TelephonePlatformType: Classification of the phone platform.""" MOBILE: Any = "MOBILE" LANDLINE: Any = "LANDLINE" VOIP: Any = "VOIP" @@ -1269,11 +813,7 @@ class Email( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Email: Group of attributes intended to hold information about email address associated with the transaction. - Attributes: - email_address(Optional[EmailStr], optional): Full email address including the alias, @ symbol, domain, and root domain. - - """ + r"""pydantic model Email: Group of attributes intended to hold information about email address associated with the transaction.""" email_address: Optional[EmailStr] = None """ Full email address including the alias, @ symbol, domain, and root domain. @@ -1285,12 +825,7 @@ class Amount( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Amount - Attributes: - value(float): The amount required in payment for the product/order in local currency (including any taxes and fees). - currency_code(constr(regex=r'^[A-Z]{3}$', max_length=3)): The ISO alpha-3 country code for the amount currency. - - """ + r"""pydantic model Amount""" value: float = None """ The amount required in payment for the product/order in local currency (including any taxes and fees). @@ -1301,84 +836,617 @@ class Amount( """ -class OrderPurchaseUpdateRequestGeneric( +class Code2( + Enum, +): + r"""pydantic model Code2: Snake cased all caps error code interpreted from the HTTP status code that can programmatically be acted upon.""" + UNAUTHORIZED: Any = "UNAUTHORIZED" + FORBIDDEN: Any = "FORBIDDEN" + NOT_FOUND: Any = "NOT_FOUND" + ACCOUNT_UPDATE_NOT_FOUND: Any = "ACCOUNT_UPDATE_NOT_FOUND" + TOO_MANY_REQUESTS: Any = "TOO_MANY_REQUESTS" + INTERNAL_SERVER_ERROR: Any = "INTERNAL_SERVER_ERROR" + BAD_GATEWAY: Any = "BAD_GATEWAY" + RETRYABLE_ACCOUNT_SCREEN_FAILURE: Any = "RETRYABLE_ACCOUNT_SCREEN_FAILURE" + RETRYABLE_ACCOUNT_UPDATE_FAILURE: Any = "RETRYABLE_ACCOUNT_UPDATE_FAILURE" + GATEWAY_TIMEOUT: Any = "GATEWAY_TIMEOUT" + BAD_REQUEST: Any = "BAD_REQUEST" + + +class AccountTakeoverError( BaseModel, smart_union=True, extra=Extra.forbid, ): - r"""pydantic model OrderPurchaseUpdateRequest: The `type` field value is used as a discriminator, with the following mapping: - * `ORDER_UPDATE`: `OrderUpdate` - * `CHARGEBACK_FEEDBACK`: `ChargebackFeedback` - * `INSULT_FEEDBACK`: `InsultFeedback` - * `REFUND_UPDATE`: `RefundUpdate` - * `PAYMENT_UPDATE`: `PaymentUpdate` - - Attributes: - type(UpdateType): -- - risk_id(constr(max_length=200)): The `risk_id` provided by Expedia's Fraud Prevention Service in the `OrderPurchaseScreenResponse`. - + r"""pydantic model AccountTakeoverError: The object used to describe an error, containing both human-readable and machine-readable information.""" + code: Code2 = Field(..., example="BAD_REQUEST") """ - type: UpdateType = None - risk_id: constr(max_length=200) = Field(..., example="123456789") + Snake cased all caps error code interpreted from the HTTP status code that can programmatically be acted upon. """ - The `risk_id` provided by Expedia's Fraud Prevention Service in the `OrderPurchaseScreenResponse`. + message: str = Field(..., example="An input validation error was encountered. Please see causes for more details.") + """ + A human-readable explanation of the error, specific to this error occurrence. """ -class OrderUpdate( - OrderPurchaseUpdateRequestGeneric, +class AccountTakeoverUnauthorizedError( + AccountTakeoverError, smart_union=True, extra=Extra.forbid, ): - r"""pydantic model OrderUpdate: Order related data that should be updated. - Attributes: - order_status(Status): -- - acquirer_reference_number(Optional[constr(max_length=200)], optional): A unique number that tags a credit or debit card transaction when it goes from the merchant's bank through to the cardholder's bank. `acquirer_reference_number` is a required field only if `order_status` = `COMPLETED` Typically, merchants can get this number from their payment processors. This number is used when dealing with disputes/chargebacks on original transactions. - cancellation_reason(Optional[CancellationReason], optional): -- - type(Literal['ORDER_UPDATE']): -- - - """ - order_status: Status = None - acquirer_reference_number: Optional[constr(max_length=200)] = None - """ - A unique number that tags a credit or debit card transaction when it goes from the merchant's bank through to the cardholder's bank. - `acquirer_reference_number` is a required field only if `order_status` = `COMPLETED` - Typically, merchants can get this number from their payment processors. - This number is used when dealing with disputes/chargebacks on original transactions. - - """ - cancellation_reason: Optional[CancellationReason] = None - type: Literal["ORDER_UPDATE"] = "ORDER_UPDATE" + r"""pydantic model AccountTakeoverUnauthorizedError: Indicates that the token sent in the 'Authorization' header is either invalid or missing. Please check the value in the token field along with the token expiration time before retrying.""" + pass -class InsultFeedback( - OrderPurchaseUpdateRequestGeneric, +class AccountUpdateNotFoundError( + AccountTakeoverError, smart_union=True, extra=Extra.forbid, ): - r"""pydantic model InsultFeedback: Feedback from EG external partners regarding a false positive recommendation that from Fraud Prevention system gave for their customer. - Attributes: - insult_detail(Optional[InsultDetail], optional): -- - type(Literal['INSULT_FEEDBACK']): -- - - """ - insult_detail: Optional[InsultDetail] = None - type: Literal["INSULT_FEEDBACK"] = "INSULT_FEEDBACK" + r"""pydantic model AccountUpdateNotFoundError: Indicates that the API cannot find the resource that is either being requested or against which the operation is being performed.""" + pass -class RefundUpdateGeneric( - OrderPurchaseUpdateRequestGeneric, +class ServiceUnavailableError( + AccountTakeoverError, smart_union=True, extra=Extra.forbid, ): - r"""pydantic model RefundUpdate: Refund related data. Update should be sent when refund is issued or settled. Amounts should include all fees and taxes. - Attributes: - refund_status(RefundStatus): Identifies the refund status. Possible values are: -`ISSUED` - The refund was issued. -`SETTLED` - The refund was settled. - type(Literal['REFUND_UPDATE']): -- + r"""pydantic model ServiceUnavailableError: Indicates that the API is either down for maintenance or overloaded and cannot fulfill the request at the current time. This is a temporary error and retrying the same request after a certain delay could eventually result in success. + There will be a Retry-After HTTP header in API response specifying how long to wait to retry the request. If there is no Retry-After HTTP header then retry can happen immediately. If the error persists after retrying with delay, please reach out to ." """ - refund_status: RefundStatus = None - """ + pass + + +class Code3( + Enum, +): + r"""pydantic model Code3""" + MISSING_MANDATORY_PARAM: Any = "MISSING_MANDATORY_PARAM" + INVALID_PARAM: Any = "INVALID_PARAM" + INVALID_FORMAT: Any = "INVALID_FORMAT" + + +class Cause1( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model Cause1""" + code: Optional[Code3] = Field(None, example="MISSING_MANDATORY_PARAM") + field: Optional[str] = Field(None, example="$.transaction.device_details.device_box") + """ + A JSON Path expression indicating which field, in the request body, caused the error. + """ + message: Optional[str] = Field(None, example="The value of a field was missed or not valid.") + + +class AccountTakeoverBadRequestError( + AccountTakeoverError, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountTakeoverBadRequestError: Indicates that a bad request occurred. Typically it is an invalid parameter.""" + causes: Optional[list[Cause1]] = None + + +class Type1( + Enum, +): + r"""pydantic model Type1: The categorized type of account update event from the Partner's system.""" + MULTI_FACTOR_AUTHENTICATION_UPDATE: Any = "MULTI_FACTOR_AUTHENTICATION_UPDATE" + REMEDIATION_UPDATE: Any = "REMEDIATION_UPDATE" + + +class AccountUpdateRequestGeneric( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountUpdateRequest: The `type` field value is used as a discriminator, with the following mapping: + * `MULTI_FACTOR_AUTHENTICATION_UPDATE`: `MultiFactorAuthenticationUpdate` + * `REMEDIATION_UPDATE`: `RemediationUpdate` + + """ + type: Type1 = None + """ + The categorized type of account update event from the Partner's system. + """ + risk_id: constr(max_length=200) = Field(..., example="123456789") + """ + The `risk_id` provided by Expedia's Fraud Prevention Service in the `AccountScreenResponse`. + """ + + +class DeliveryMethod( + Enum, +): + r"""pydantic model DeliveryMethod: The delivery method of the Multi-Factor Authentication to a user.""" + EMAIL: Any = "EMAIL" + SMS: Any = "SMS" + VOICE: Any = "VOICE" + PUSH: Any = "PUSH" + + +class Status1( + Enum, +): + r"""pydantic model Status1: The status of a user''s response to the Multi-Factor Authentication initiated by the Partner''s system to the user.' + - `SUCCESS` - Applicable if the user successfully passed the challenge. + - `ABANDON` - Applicable if the user did not complete the challenge. + - `FAILED` - Applicable if the user failed the challenge. + + """ + SUCCESS: Any = "SUCCESS" + ABANDON: Any = "ABANDON" + FAILED: Any = "FAILED" + + +class ActionName( + Enum, +): + r"""pydantic model ActionName: The categorized remediation action initiated by the Partner''s system to a user. Possible values are: + - `PASSWORD_RESET` - Applicable if this event is the result of a password reset by the Partner''s system. + - `DISABLE_ACCOUNT` - Applicable if this event is the result of disabling an account by the Partner''s system. + - `TERMINATE_ALL_SESSIONS` - Applicable if this event is the result of terminating all active user sessions of an account by the Partner''s system. + + """ + PASSWORD_RESET: Any = "PASSWORD_RESET" + DISABLE_ACCOUNT: Any = "DISABLE_ACCOUNT" + TERMINATE_ALL_SESSIONS: Any = "TERMINATE_ALL_SESSIONS" + + +class Status2( + Enum, +): + r"""pydantic model Status2: The status of the remediation action. + - `SUCCESS` - Applicable if the Partner''s system was successfully able to perform the remediation action. + - `FAILED` - Applicable if the Partner''s system failed to perform the remediation action. + + """ + SUCCESS: Any = "SUCCESS" + FAILED: Any = "FAILED" + + +class RemediationUpdateAction( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model RemediationUpdateAction: Information specific to the remediation action initiated by the Partner's system to a user.""" + action_name: ActionName = None + """ + The categorized remediation action initiated by the Partner''s system to a user. Possible values are: + - `PASSWORD_RESET` - Applicable if this event is the result of a password reset by the Partner''s system. + - `DISABLE_ACCOUNT` - Applicable if this event is the result of disabling an account by the Partner''s system. + - `TERMINATE_ALL_SESSIONS` - Applicable if this event is the result of terminating all active user sessions of an account by the Partner''s system. + + """ + status: Status2 = None + """ + The status of the remediation action. + - `SUCCESS` - Applicable if the Partner''s system was successfully able to perform the remediation action. + - `FAILED` - Applicable if the Partner''s system failed to perform the remediation action. + + """ + update_end_date_time: Optional[datetime] = None + """ + The local date and time the remediation action to a user ended in the Partner's system, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + """ + + +class AccountUpdateResponse( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountUpdateResponse""" + risk_id: Optional[constr(max_length=200)] = Field(None, example="1234567") + """ + Unique identifier of transaction that was updated. + """ + + +class AccountTakeoverFraudDecision( + Enum, +): + r"""pydantic model AccountTakeoverFraudDecision: Fraud recommendation for an account transaction. A recommendation can be ACCEPT, CHALLENGE, or REJECT. + - `ACCEPT` - Represents an account transaction where the user’’s account activity is accepted. + - `CHALLENGE` - Represents an account transaction that requires additional verification or challenges the user’’s identity (example: CAPTCHA, MULTI_FACTOR_AUTHENTICATION, etc). + - `REJECT` - Represents a suspicious account transaction where the user’’s credentials or their behavior requires us to block the account activity. + + """ + ACCEPT: Any = "ACCEPT" + CHALLENGE: Any = "CHALLENGE" + REJECT: Any = "REJECT" + + +class PlacementName( + Enum, +): + r"""pydantic model PlacementName: The categorized name of the page where a user initiated event is being evaluated. + - `LOGIN` - Applicable if the user initiated this account event from a login web page. + - `PASSWORD_RESET` - Applicable if the user initiated this account event from a password reset web page. + + """ + LOGIN: Any = "LOGIN" + PASSWORD_RESET: Any = "PASSWORD_RESET" + + +class AccountTakeoverSiteInfo( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountTakeoverSiteInfo: Information specific to the Partner's website through which a transaction was made.""" + locale: Optional[constr(regex=r"^([a-z]{2}-[A-Z]{2})$")] = Field(None, example="en-US") + """ + The locale of the website a user is accessing, which is separate from the user configured browser locale, in ISO 639-2 language code format and in ISO 3166-1 country code format. + """ + name: Optional[constr(max_length=200)] = Field(None, example="expedia.com") + """ + Name of the website from which the event is generated. + """ + brand_name: constr(max_length=200) = None + """ + The trademark brand name that is displayed to a user on the website. + """ + placement_name: Optional[PlacementName] = None + """ + The categorized name of the page where a user initiated event is being evaluated. + - `LOGIN` - Applicable if the user initiated this account event from a login web page. + - `PASSWORD_RESET` - Applicable if the user initiated this account event from a password reset web page. + + """ + + +class Type2( + Enum, +): + r"""pydantic model Type2: The categorized type of device used by a user. Possible values are: + - `WEBSITE` - Applicable if the user initiated this event from a web browser on a desktop computer. + - `PHONE_WEB` - Applicable if the user initiated this event from a web browser on a phone. + - `TABLET_WEB` - Applicable if the user initiated this event from a web browser on a tablet. + - `PHONE_APP` - Applicable if the user initiated this event from an app on a phone. + - `TABLET_APP` - Applicable if the user initiated this event from an app on a tablet. + + """ + WEBSITE: Any = "WEBSITE" + PHONE_WEB: Any = "PHONE_WEB" + TABLET_WEB: Any = "TABLET_WEB" + PHONE_APP: Any = "PHONE_APP" + TABLET_APP: Any = "TABLET_APP" + + +class AccountTakeoverDeviceDetails( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountTakeoverDeviceDetails: Information specific to the Partner's device through which a transaction was made.""" + source: Optional[constr(max_length=50)] = None + """ + Source of the device_box. Default value is `TrustWidget`. + """ + device_box: constr(max_length=16000) = None + """ + Device related information retrieved from TrustWidget. + """ + ip_address: constr( + regex=r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$" + ) = Field(..., example="192.168.32.48") + """ + IP address of the device used for this event. + """ + user_agent: constr(max_length=200) = Field( + ..., example="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" + ) + """ + The application type, operating system, software vendor, or software version of the originating request. + """ + type: Optional[Type2] = None + """ + The categorized type of device used by a user. Possible values are: + - `WEBSITE` - Applicable if the user initiated this event from a web browser on a desktop computer. + - `PHONE_WEB` - Applicable if the user initiated this event from a web browser on a phone. + - `TABLET_WEB` - Applicable if the user initiated this event from a web browser on a tablet. + - `PHONE_APP` - Applicable if the user initiated this event from an app on a phone. + - `TABLET_APP` - Applicable if the user initiated this event from an app on a tablet. + + """ + + +class AccountType1( + Enum, +): + r"""pydantic model AccountType1: Identifies the account type of a user''s account. Possible values are: + - `INDIVIDUAL` - Applicable if this account is for an individual traveler. + - `BUSINESS` - Applicable if this account is for a business or organization account used by suppliers or Partners. + + """ + INDIVIDUAL: Any = "INDIVIDUAL" + BUSINESS: Any = "BUSINESS" + + +class AccountRole( + Enum, +): + r"""pydantic model AccountRole: Identifies the account role and associated permissions of a user''s account. Possible values are: + - `USER`: Basic account with no special privileges. + - `MANAGER`: Account with additional privileges, such as the ability to make bookings for others. + - `ADMIN`: Account with higher privileges than a manager, including the ability to grant manager access to other users. + + """ + USER: Any = "USER" + MANAGER: Any = "MANAGER" + ADMIN: Any = "ADMIN" + + +class AccountTakeoverName( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountTakeoverName: Group of attributes intended to hold information about a customer or traveler''s name for the account.""" + last_name: constr(max_length=200) = None + """ + Surname, or last name, of the person. + """ + first_name: constr(max_length=200) = None + """ + Given, or first name, of the person. + """ + middle_name: Optional[constr(max_length=200)] = None + """ + Middle name of the person. + """ + title: Optional[constr(max_length=200)] = None + """ + Title of the person for name (e.g. Mr., Ms. etc). + """ + suffix: Optional[constr(max_length=50)] = None + """ + Generational designations (e.g. Sr, Jr, III) or values indicate that the individual holds a position, educational degree, accreditation, office, or honor (e.g. PhD, CCNA, OBE). + """ + + +class Type3( + Enum, +): + r"""pydantic model Type3: The categorized type of account event related to a user's action.""" + LOGIN: Any = "LOGIN" + + +class AuthenticationType( + Enum, +): + r"""pydantic model AuthenticationType: The type of login authentication method used by a user. + For `authentication_type` ensure attributes mentioned in dictionary below are set to corresponding values only. + `authentication_type` is an enum value with the following mapping with `authentication_sub_type` attribute: + * authentication_type : authentication_sub_type + * ------------------------------------------------------------------------------- + * `CREDENTIALS` : `EMAIL` + * `CREDENTIALS` : + * `PASSWORD_RESET` : `EMAIL` + * `SINGLE_SIGN_ON` : `EMAIL` + * `MULTI_FACTOR_AUTHENTICATION` : `EMAIL` + * `MULTI_FACTOR_AUTHENTICATION` : `PHONE` + * `SOCIAL` : `GOOGLE` + * `SOCIAL` : `FACEBOOK` + * `SOCIAL` : `APPLE` + + """ + CREDENTIALS: Any = "CREDENTIALS" + PASSWORD_RESET: Any = "PASSWORD_RESET" + SOCIAL: Any = "SOCIAL" + SINGLE_SIGN_ON: Any = "SINGLE_SIGN_ON" + MULTI_FACTOR_AUTHENTICATION: Any = "MULTI_FACTOR_AUTHENTICATION" + + +class AuthenticationSubType( + Enum, +): + r"""pydantic model AuthenticationSubType: The sub type of login authentication method used by a user. + For `authentication_sub_type` ensure attributes mentioned in dictionary below are set to corresponding values only. + `authentication_sub_type` is an enum value with the following mapping with `authentication_type` attribute: + * authentication_sub_type : authentication_type + * ------------------------------------------------------------------------------- + * `EMAIL` : `CREDENTIALS` + * `EMAIL` : `PASSWORD_RESET` + * `EMAIL` : `SINGLE_SIGN_ON` + * `EMAIL` : `MULTI_FACTOR_AUTHENTICATION` + * `PHONE` : `MULTI_FACTOR_AUTHENTICATION` + * `GOOGLE` : `SOCIAL` + * `FACEBOOK` : `SOCIAL` + * `APPLE` : `SOCIAL` + * : `CREDENTIALS` + + """ + EMAIL: Any = "EMAIL" + PHONE: Any = "PHONE" + GOOGLE: Any = "GOOGLE" + FACEBOOK: Any = "FACEBOOK" + APPLE: Any = "APPLE" + + +class FailedLoginReason( + Enum, +): + r"""pydantic model FailedLoginReason: The reason for the failed login attempt in the Partner''s system, related to user failure or Partner''s system failure. + - `INVALID_CREDENTIALS` - Applicable if the user provided invalid login credentials for this login attempt. + - `ACCOUNT_NOT_FOUND` - Applicable if the user attempted to login to an account that doesn't exist. + - `VERIFICATION_FAILED` - Applicable if the user failed the verification for this login, or any authentication exception occured in the Partner system for this login attempt. + - `ACCOUNT_LOCKED` - Applicable if the user attempted to login to an account that is locked. + + """ + INVALID_CREDENTIALS: Any = "INVALID_CREDENTIALS" + ACCOUNT_NOT_FOUND: Any = "ACCOUNT_NOT_FOUND" + VERIFICATION_FAILED: Any = "VERIFICATION_FAILED" + ACCOUNT_LOCKED: Any = "ACCOUNT_LOCKED" + + +class Type4( + Enum, +): + r"""pydantic model Type4: The kind of challenge served by the Partner''s system to a user prior to calling Expedia''s Fraud Prevention Service. + - `CAPTCHA` - Applicable if the challenge served by the Partner''s system was a Captcha challenge. + - `TWO_FACTOR` - Applicable if the challenge served by the Partner''s system was a two-factor challenge including (Email verification, One Time Password, Okta, etc). + + """ + CAPTCHA: Any = "CAPTCHA" + TWO_FACTOR: Any = "TWO_FACTOR" + + +class Status3( + Enum, +): + r"""pydantic model Status3: The status of the challenge served by the Partner''s system to a user before calling Expedia''s Fraud Prevention Service. + - `SUCCESS` - Applicable if the user successfully passed the challenge. + - `FAILED` - Applicable if the user failed the challenge. + + """ + SUCCESS: Any = "SUCCESS" + FAILED: Any = "FAILED" + + +class ChallengeDetail( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model ChallengeDetail: Information related to challenges initiated by the Partner's system to a user before calling Expedia's Fraud Prevention Service.""" + displayed_flag: bool = None + """ + Indicates that there was a challenge initiated by the Partner's system to a user before calling Expedia's Fraud Prevention Service. + """ + type: Type4 = None + """ + The kind of challenge served by the Partner''s system to a user prior to calling Expedia''s Fraud Prevention Service. + - `CAPTCHA` - Applicable if the challenge served by the Partner''s system was a Captcha challenge. + - `TWO_FACTOR` - Applicable if the challenge served by the Partner''s system was a two-factor challenge including (Email verification, One Time Password, Okta, etc). + + """ + status: Status3 = None + """ + The status of the challenge served by the Partner''s system to a user before calling Expedia''s Fraud Prevention Service. + - `SUCCESS` - Applicable if the user successfully passed the challenge. + - `FAILED` - Applicable if the user failed the challenge. + + """ + + +class ForbiddenError( + AccountTakeoverError, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model ForbiddenError: Indicates that the API cannot fulfill the request because while the client is correctly authenticated, the client doesn't have the permission to execute the specified operation. This error type does not imply that the request is valid, or that the resource against which the operation being performed exists or satisfies other pre-conditions.""" + pass + + +class NotFoundError( + AccountTakeoverError, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model NotFoundError: Indicates that the API cannot find the resource that is either being requested or against which the operation is being performed. Please check the request again to make sure that the request is valid.""" + pass + + +class TooManyRequestsError( + AccountTakeoverError, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model TooManyRequestsError: Indicates that the API cannot fulfill the request because server resources have been exhausted. Perhaps the client has sent too many requests in a given amount of time or has reached some specific quota. Please check the rate limits for the product and adjust as necessary before retries. If you believe the rate limit was incorrect or if you need a different rate limit, please reach out to the regarding the next steps.""" + pass + + +class InternalServerError( + AccountTakeoverError, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model InternalServerError: Indicates that the API encountered an unexpected condition that prevented it from fulfilling the request. Sometimes used as a generic catch-allerror type when no other error types can be used. Retrying the same request will usually result in the same error. Please reach out to support team as next step for this error resolution.""" + pass + + +class BadGatewayError( + AccountTakeoverError, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model BadGatewayError: Indicates that the server received an invalid response from the upstream server. Causes could be incorrectly configured target server at gateway, EOF exception, incorrectly configured keep-alive timeouts. Please reach out to support team as next step for this error resolution.""" + pass + + +class GatewayTimeoutError( + AccountTakeoverError, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model GatewayTimeoutError: Indicates that the API gateway has issues completing the request on time. Request can be retried if it is idempotent, If the issue persists, please reach out to support. For non-idempotent requests, please reach out to to know the status of your request before attempting retries.""" + pass + + +class OrderPurchaseUpdateRequestGeneric( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model OrderPurchaseUpdateRequest: The `type` field value is used as a discriminator, with the following mapping: + * `ORDER_UPDATE`: `OrderUpdate` + * `CHARGEBACK_FEEDBACK`: `ChargebackFeedback` + * `INSULT_FEEDBACK`: `InsultFeedback` + * `REFUND_UPDATE`: `RefundUpdate` + * `PAYMENT_UPDATE`: `PaymentUpdate` + + """ + type: UpdateType = None + risk_id: constr(max_length=200) = Field(..., example="123456789") + """ + The `risk_id` provided by Expedia's Fraud Prevention Service in the `OrderPurchaseScreenResponse`. + """ + + +class OrderUpdate( + OrderPurchaseUpdateRequestGeneric, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model OrderUpdate: Order related data that should be updated.""" + order_status: Status = None + acquirer_reference_number: Optional[constr(max_length=200)] = None + """ + A unique number that tags a credit or debit card transaction when it goes from the merchant's bank through to the cardholder's bank. + `acquirer_reference_number` is a required field only if `order_status` = `COMPLETED` + Typically, merchants can get this number from their payment processors. + This number is used when dealing with disputes/chargebacks on original transactions. + + """ + cancellation_reason: Optional[CancellationReason] = None + type: Literal["ORDER_UPDATE"] = "ORDER_UPDATE" + + +class InsultFeedback( + OrderPurchaseUpdateRequestGeneric, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model InsultFeedback: Feedback from EG external partners regarding a false positive recommendation that from Fraud Prevention system gave for their customer.""" + insult_detail: Optional[InsultDetail] = None + type: Literal["INSULT_FEEDBACK"] = "INSULT_FEEDBACK" + + +class RefundUpdateGeneric( + OrderPurchaseUpdateRequestGeneric, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model RefundUpdate: Refund related data. Update should be sent when refund is issued or settled. Amounts should include all fees and taxes.""" + refund_status: RefundStatus = None + """ Identifies the refund status. Possible values are: -`ISSUED` - The refund was issued. -`SETTLED` - The refund was settled. @@ -1392,12 +1460,7 @@ class IssuedRefundUpdateDetails( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model IssuedRefundUpdateDetails: Data that describes issued refund that should be updated. - Attributes: - refund_issued_date_time(datetime): Date and time when the 3rd party payment processor confirmed that a previously submitted payment refund has issued at the participating financial institutions. - refund_issued_amount(Amount): -- - - """ + r"""pydantic model IssuedRefundUpdateDetails: Data that describes issued refund that should be updated.""" refund_issued_date_time: datetime = None """ Date and time when the 3rd party payment processor confirmed that a previously submitted payment refund has issued at the participating financial institutions. @@ -1410,15 +1473,7 @@ class SettledRefundUpdateDetails( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model SettledRefundUpdateDetails: Data that describes settled refund that should be updated. - Attributes: - refund_settlement_date_time(datetime): Date and time when the 3rd party payment processor confirmed that a previously submitted payment refund has settled at the participating financial institutions. - refund_deposit_date_time(datetime): Date and time when the refund was deposited to the original form of payment. - acquirer_reference_number(constr(max_length=200)): A unique number that tags a credit or debit card transaction when it goes from the merchant's bank through to the cardholder's bank. Typically, merchants can get this number from their payment processors. This number is used when dealing with disputes/chargebacks on original transactions. - settlement_id(constr(max_length=200)): Unique settlement identifier specific to the payment processor for the settlement transaction generated for a previously submitted payment refund. - refund_settled_amount(Amount): -- - - """ + r"""pydantic model SettledRefundUpdateDetails: Data that describes settled refund that should be updated.""" refund_settlement_date_time: datetime = None """ Date and time when the 3rd party payment processor confirmed that a previously submitted payment refund has settled at the participating financial institutions. @@ -1446,12 +1501,7 @@ class PaymentUpdate( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model PaymentUpdate: Payment related data that should be updated. - Attributes: - merchant_order_code(constr(max_length=200)): Reference code passed to acquiring bank at the time of payment. This code is the key ID that ties back to payments data at the payment level. - type(Literal['PAYMENT_UPDATE']): -- - - """ + r"""pydantic model PaymentUpdate: Payment related data that should be updated.""" merchant_order_code: constr(max_length=200) = None """ Reference code passed to acquiring bank at the time of payment. This code is the key ID that ties back to payments data at the payment level. @@ -1464,15 +1514,7 @@ class ChargebackDetail( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model ChargebackDetail: Details related to the chargeback. - Attributes: - chargeback_status(ChargebackStatus): Identifies the chargeback status. Possible values are: -`RECEIVED` - The chargeback was received. -`REVERSAL` - The chargeback reversal was received. - chargeback_reason(ChargebackReason): Reason for chargeback which can be `Fraud` or `Non Fraud`. - chargeback_amount(Amount): -- - bank_reason_code(Optional[constr(max_length=200)], optional): Unique code provided by the acquiring bank for the category of fraud. - chargeback_reported_date_time(Optional[datetime], optional): Date and time when the chargeback was reported to the partner, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - - """ + r"""pydantic model ChargebackDetail: Details related to the chargeback.""" chargeback_status: ChargebackStatus = None """ Identifies the chargeback status. Possible values are: @@ -1491,7 +1533,7 @@ class ChargebackDetail( """ chargeback_reported_date_time: Optional[datetime] = None """ - Date and time when the chargeback was reported to the partner, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Date and time when the chargeback was reported to the partner, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ @@ -1500,12 +1542,7 @@ class OrderPurchaseScreenResponse( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model OrderPurchaseScreenResponse - Attributes: - risk_id(Optional[constr(max_length=200)], optional): Unique identifier assigned to the transaction by Expedia's Fraud Prevention Service. - decision(Optional[FraudDecision], optional): -- - - """ + r"""pydantic model OrderPurchaseScreenResponse""" risk_id: Optional[constr(max_length=200)] = Field(None, example="1234567") """ Unique identifier assigned to the transaction by Expedia's Fraud Prevention Service. @@ -1525,14 +1562,6 @@ class TravelProductGeneric( * `INSURANCE`: `Insurance` * `HOTEL`: `Hotel` * `RAIL`: `Rail` - * `ACTIVITIES`: `Activities` - - Attributes: - price(Amount): -- - type(TravelProductType): -- - inventory_type(constr(max_length=30)): Type of inventory. Ensure attributes mentioned in dictionary below are set to corresponding values only. `inventory_type` has the following mapping with TravelProduct `type` attribute: * inventory_type : type * ------------------------------------------------------ * `Cruise` : `CRUISE` * `Air` : `AIR` * `Car` : `CAR` * `Insurance` : `INSURANCE` * `Hotel` : `HOTEL` * `Rail` : `RAIL` * `Activities` : `ACTIVITIES` - inventory_source(InventorySource): Identifies the business model through which the supply is being sold. Merchant/Agency. * `MERCHANT` is used when Partner is the merchant of record for this order. * `AGENCY` is used when this order is through an agency booking. - travelers_references(list[constr(max_length=50)]): List of travelerGuids who are part of the traveling party on the order for the product. Information for each product and its required travelers should be provided in the API request. If the product booking does not require accompanying quest information then that does not need to be provided in the API request. Example: * For Air products, all travelers' details are required to complete the booking. * For Hotel products, typically the details on the person checking-in is required. * For Car products, typically only the primary driver information is required. If multiple traveler details are in the itinerary, this structure allows to fill up traveler details once in the `travelers` section, and then associate individual products to the respective travelers. This association is made using `traveler_id` field. A GUID can be generated for each object in the `travelers` section. The same GUID can be provided in the `traveler_references` below. The `travelers` array should have at least one `traveler` object, and each `traveler` object should have a `traveler_id` which is not necessarily an account id. Example: * Travelers * ------------ * A - GUID1 * B - GUID2 * C - GUID3 * * Products * ------------ * Air * [GUID1, GUID2, GUID3] * Hotel * [GUID1] * Car * [GUID3] * Rail * [GUID2] * Activities * [GUID1] * The example above demonstrates the association of travelers with various products. * All three travelers (A, B, and C) are associated with the Air product. * Traveler A is associated with the Hotel and Activities products. * Traveler C is associated with the Car product. * Traveler B is associated with the Rail product. """ price: Amount = None @@ -1550,7 +1579,6 @@ class TravelProductGeneric( * `Insurance` : `INSURANCE` * `Hotel` : `HOTEL` * `Rail` : `RAIL` - * `Activities` : `ACTIVITIES` """ inventory_source: InventorySource = None @@ -1560,7 +1588,7 @@ class TravelProductGeneric( * `AGENCY` is used when this order is through an agency booking. """ - travelers_references: list[constr(max_length=50)] = Field(..., maxItems=40, minItems=1) + travelers_references: Optional[list[constr(max_length=50)]] = Field(None, maxItems=40, minItems=1) """ List of travelerGuids who are part of the traveling party on the order for the product. Information for each product and its required travelers should be provided in the API request. @@ -1589,15 +1617,24 @@ class TravelProductGeneric( * [GUID3] * Rail * [GUID2] - * Activities - * [GUID1] * The example above demonstrates the association of travelers with various products. * All three travelers (A, B, and C) are associated with the Air product. - * Traveler A is associated with the Hotel and Activities products. + * Traveler A is associated with the Hotel. * Traveler C is associated with the Car product. * Traveler B is associated with the Rail product. """ + pay_later: Optional[bool] = None + """ + The attribute serves as a boolean indicator that significantly influences the handling of payment information during the fraud prevention process: + * When 'pay_later' is set to 'true': + - This configuration signals that payment information is optional for the booking. Travelers are given the choice to defer payment until they arrive at the rental counter following the completion of the booking. + - It is imperative for partners to explicitly set this attribute to 'true' when payment information can be optional for a particular booking scenario. + * When 'pay_later' is set to 'false': + - In this mode, the attribute mandates the inclusion of payment information during the order purchase screen request. Travelers are required to provide payment details. + - Partners must exercise caution and ensure they supply the necessary payment information, as failure to do so in cases where 'pay_later' is set to 'false' will result in a 'Bad Request' error. This error helps maintain the consistency and accuracy of the fraud prevention process and payment handling. + + """ class RailSegments( @@ -1605,23 +1642,14 @@ class RailSegments( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model RailSegments - Attributes: - departure_time(datetime): The local date and time of the scheduled departure from the departure station, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - arrival_time(datetime): The local date and time of the scheduled arrival at the destination station, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - departure_station(RailwayStationDetails): -- - arrival_station(RailwayStationDetails): -- - transportation_method(TransportationMethod): This attribute represents the specific transportation method by which the passenger is traveling. It captures the mode of transportation used during the Rail product journey, Possible values are: - `BUS` - The Rail product includes bus transportation for certain segments of the itinerary. - `FERRY` - The Rail product involves ferry transportation as part of the journey. - `PUBLIC_TRANSPORT` - The Rail product represents the use of public transportation modes for the journey. - `TRAM` - The Rail product includes tram transportation as part of the journey. - `RAIL` - The Rail product specifically utilizes train transportation for the journey. - `TRANSFER` - The Rail product involves transfers between different modes of transportation. - `OTHER` - The Rail product utilizes transportation methods not covered by the aforementioned categories. - operating_company(Optional[OperatingCompany], optional): This attribute captures the name or identifier of the company responsible for operating the Rail product. It represents the specific operating entity, such as Amtrak, British Railways, or a bus company. - - """ + r"""pydantic model RailSegments""" departure_time: datetime = None """ - The local date and time of the scheduled departure from the departure station, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + The local date and time of the scheduled departure from the departure station, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ arrival_time: datetime = None """ - The local date and time of the scheduled arrival at the destination station, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + The local date and time of the scheduled arrival at the destination station, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ departure_station: RailwayStationDetails = None arrival_station: RailwayStationDetails = None @@ -1643,68 +1671,19 @@ class RailSegments( """ -class Activities( - TravelProductGeneric, - smart_union=True, - extra=Extra.forbid, -): - r"""pydantic model Activities - Attributes: - activity(Activity): -- - operating_company(OperatingCompanyModel): -- - is_coupon_required(Optional[bool], optional): A coupon is typically a document or electronic code that confirms your reservation or purchase for the activity. It serves as proof of payment and allows you to participate in the activity. This field indicates whether a coupon is necessary for this activity. | For example, let's consider two scenarios: | Activity: Adventure Park | is_coupon_required: false | In this case, the attribute is set to 'false,' indicating that no coupon is necessary. However, you might still need to purchase a ticket to gain entry to the adventure park. The ticket serves as proof of payment and grants you access to the park's activities and attractions. | Activity: Spa Package | is_coupon_required: true | Here, the attribute is set to 'true,' indicating that a coupon is required. To participate in the spa package, you would need to present the designated coupon at the spa. The coupon confirms your reservation, serves as proof of payment, and may entitle you to specific spa treatments or discounts. - location_coordinates(Optional[Coordinates], optional): -- - start_time(datetime): The field represents the start time of a activity, using the ISO-8061 date and time format yyyy-MM-ddTHH:mm:ss.SSSZ. - end_time(datetime): The field represents the end time of a activity, using the ISO-8061 date and time format yyyy-MM-ddTHH:mm:ss.SSSZ. - ticket(list[Ticket]): This field provides information about the tickets available for the activity. - type(Literal['ACTIVITIES']): -- - - """ - activity: Activity = None - operating_company: OperatingCompanyModel = None - is_coupon_required: Optional[bool] = None - """ - A coupon is typically a document or electronic code that confirms your reservation or purchase for the activity. It serves as proof of payment and allows you to participate in the activity. This field indicates whether a coupon is necessary for this activity. | For example, let's consider two scenarios: | Activity: Adventure Park | is_coupon_required: false | In this case, the attribute is set to 'false,' indicating that no coupon is necessary. However, you might still need to purchase a ticket to gain entry to the adventure park. The ticket serves as proof of payment and grants you access to the park's activities and attractions. | Activity: Spa Package | is_coupon_required: true | Here, the attribute is set to 'true,' indicating that a coupon is required. To participate in the spa package, you would need to present the designated coupon at the spa. The coupon confirms your reservation, serves as proof of payment, and may entitle you to specific spa treatments or discounts. - """ - location_coordinates: Optional[Coordinates] = None - start_time: datetime = None - """ - The field represents the start time of a activity, using the ISO-8061 date and time format yyyy-MM-ddTHH:mm:ss.SSSZ. - """ - end_time: datetime = None - """ - The field represents the end time of a activity, using the ISO-8061 date and time format yyyy-MM-ddTHH:mm:ss.SSSZ. - """ - ticket: list[Ticket] = Field(..., maxItems=40, minItems=1) - """ - This field provides information about the tickets available for the activity. - """ - type: Literal["ACTIVITIES"] = "ACTIVITIES" - - class Air( TravelProductGeneric, smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Air - Attributes: - departure_time(datetime): Local date and time of departure from original departure location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - arrival_time(datetime): Local date and time of arrival to final destination location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - air_segments(list[AirSegment]): Additional airline and flight details for each of the trip segments. - flight_type(Optional[FlightType], optional): Identifies the type of air trip based on the air destinations. - passenger_name_record(Optional[constr(max_length=100)], optional): Airline booking confirmation code for the trip. - global_distribution_system_type(Optional[constr(max_length=100)], optional): Associated with Passenger Name Record (PNR). - type(Literal['AIR']): -- - - """ + r"""pydantic model Air""" departure_time: datetime = None """ - Local date and time of departure from original departure location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time of departure from original departure location, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ arrival_time: datetime = None """ - Local date and time of arrival to final destination location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time of arrival to final destination location, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ air_segments: list[AirSegment] = Field(..., maxItems=30, minItems=1) """ @@ -1730,23 +1709,14 @@ class Cruise( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Cruise - Attributes: - departure_time(datetime): Local date and time of departure from original departure location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - arrival_time(datetime): Local date and time of arrival from original arrival location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - embarkation_port(constr(max_length=200)): Location from where cruise will depart. - disembarkation_port(constr(max_length=200)): The cruise's final destination. - ship_name(constr(max_length=200)): Name of the cruise ship. - type(Literal['CRUISE']): -- - - """ + r"""pydantic model Cruise""" departure_time: datetime = None """ - Local date and time of departure from original departure location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time of departure from original departure location, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ arrival_time: datetime = None """ - Local date and time of arrival from original arrival location, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time of arrival from original arrival location, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ embarkation_port: constr(max_length=200) = None """ @@ -1768,15 +1738,7 @@ class Car( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Car - Attributes: - pick_up_location(constr(max_length=200)): Location where the automobile will be picked up. - drop_off_location(constr(max_length=200)): Location at which the automobile will be returned. - pickup_time(datetime): Local date and time the automobile will be picked-up, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - return_time(datetime): Local date and time the automobile will be returned, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - type(Literal['CAR']): -- - - """ + r"""pydantic model Car""" pick_up_location: constr(max_length=200) = None """ Location where the automobile will be picked up. @@ -1787,11 +1749,11 @@ class Car( """ pickup_time: datetime = None """ - Local date and time the automobile will be picked-up, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time the automobile will be picked-up, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ return_time: datetime = None """ - Local date and time the automobile will be returned, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time the automobile will be returned, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ type: Literal["CAR"] = "CAR" @@ -1801,18 +1763,7 @@ class Hotel( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Hotel - Attributes: - hotel_id(constr(max_length=200)): Unique hotel identifier assigned by the partner. - price_withheld(Optional[bool], optional): Identifies if the product price was withheld from the customer during the booking process. - hotel_name(constr(max_length=200)): Name of the hotel. - room_count(Optional[int], optional): Total number of rooms booked within the hotel product collection. - address(HotelAddress): -- - checkin_time(datetime): Local date and time of the hotel check-in, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - checkout_time(datetime): Local date and time of the hotel check-out, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - type(Literal['HOTEL']): -- - - """ + r"""pydantic model Hotel""" hotel_id: constr(max_length=200) = Field(..., example="8883333999221") """ Unique hotel identifier assigned by the partner. @@ -1832,11 +1783,11 @@ class Hotel( address: HotelAddress = None checkin_time: datetime = None """ - Local date and time of the hotel check-in, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time of the hotel check-in, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ checkout_time: datetime = None """ - Local date and time of the hotel check-out, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Local date and time of the hotel check-out, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ type: Literal["HOTEL"] = "HOTEL" @@ -1846,13 +1797,7 @@ class PaymentOutcome( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model PaymentOutcome - Attributes: - status(Optional[PaymentStatus], optional): -- - code(Optional[constr(max_length=200)], optional): A mnemonic code for the payment processing. - description(Optional[constr(max_length=200)], optional): A short description providing additional explanation regarding the mnemonic code. - - """ + r"""pydantic model PaymentOutcome""" status: Optional[PaymentStatus] = None code: Optional[constr(max_length=200)] = None """ @@ -1869,11 +1814,7 @@ class Insurance( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Insurance - Attributes: - type(Literal['INSURANCE']): -- - - """ + r"""pydantic model Insurance""" type: Literal["INSURANCE"] = "INSURANCE" @@ -1882,19 +1823,7 @@ class Telephone( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Telephone: Group of attributes intended to hold information about phone number associated with the transaction. A user can have one to many phone numbers (home, work, mobile, etc.). - Attributes: - type(Optional[TelephoneType], optional): -- - platform_type(Optional[TelephonePlatformType], optional): -- - country_access_code(constr(regex=r'^[0-9]{1,3}$', max_length=3)): Numeric digit between 1 to 3 characters used to represent the country code for international dialing. Does not include symbols, spaces, or leading zeros. - area_code(constr(regex=r'^[0-9]{1,20}$', max_length=20)): A number prefixed to an individual telephone number: used in making long-distance calls. Does not include symbols, spaces, or leading zeros. - phone_number(constr(regex=r'^[0-9]{1,50}$', max_length=50)): A number that is dialed on a telephone, without the country or area codes, to reach a particular person, business, etc. Does not include symbols, spaces, or leading zeros. - extension_number(Optional[constr(regex=r'^[0-9]{1,20}$', max_length=20)], optional): The number used to reach an individual once a phone connection is established. Does not include symbols, spaces, or leading zeros. - preference_rank(Optional[float], optional): Ranking of order of user preference for contact via text (if type is Mobile) or voice. `0` means no preference. `1` is the primary phone, `2` is the secondary phone, etc. - last_verified_date_time(Optional[datetime], optional): Local date and time user validated possession of their phone number via a text or voice multi factor authentication challenge, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - verified_flag(Optional[bool], optional): Flag indicating whether user passed validation of possession of their phone number via a text or voice multi factor authentication challenge. - - """ + r"""pydantic model Telephone: Group of attributes intended to hold information about phone number associated with the transaction. A user can have one to many phone numbers (home, work, mobile, etc.).""" type: Optional[TelephoneType] = None platform_type: Optional[TelephonePlatformType] = None country_access_code: constr(regex=r"^[0-9]{1,3}$", max_length=3) = Field(..., example="1") @@ -1917,14 +1846,155 @@ class Telephone( """ Ranking of order of user preference for contact via text (if type is Mobile) or voice. `0` means no preference. `1` is the primary phone, `2` is the secondary phone, etc. """ - last_verified_date_time: Optional[datetime] = None + last_verified_date_time: Optional[datetime] = None + """ + Local date and time user validated possession of their phone number via a text or voice multi factor authentication challenge, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + """ + verified_flag: Optional[bool] = None + """ + Flag indicating whether user passed validation of possession of their phone number via a text or voice multi factor authentication challenge. + """ + + +class MultiFactorAuthenticationAttempt( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model MultiFactorAuthenticationAttempt: Information specific to the update event by a user.""" + delivery_method: DeliveryMethod = None + """ + The delivery method of the Multi-Factor Authentication to a user. + """ + status: Status1 = None + """ + The status of a user''s response to the Multi-Factor Authentication initiated by the Partner''s system to the user.' + - `SUCCESS` - Applicable if the user successfully passed the challenge. + - `ABANDON` - Applicable if the user did not complete the challenge. + - `FAILED` - Applicable if the user failed the challenge. + + """ + reference_id: constr(max_length=200) = None + """ + The identifier related to a Multi-Factor Authentication attempt by the Partner's system to the Multi-Factor Authentication provider. + """ + provider_name: constr(max_length=200) = None + """ + The vendor providing the Multi-Factor Authentication verification. + """ + attempt_count: float = None + """ + The number of attempts a user tried for this Multi-Factor Authentication. + """ + update_start_date_time: Optional[datetime] = None + """ + The local date and time the Multi-Factor Authentication was initiated to a user from the Partner's system, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + """ + update_end_date_time: Optional[datetime] = None + """ + The local date and time the Multi-Factor Authentication to a user ended in the Partner's system, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + """ + telephone: Optional[Telephone] = None + email_address: Optional[EmailStr] = None + """ + Email address used for the Multi-Factor Authentication by a user. + """ + + +class RemediationUpdate( + AccountUpdateRequestGeneric, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model RemediationUpdate: Information specific to remediation actions initiated by the Partner's system to a user as a result of a fraud recommendation.""" + remediation_update_actions: list[RemediationUpdateAction] = Field(..., maxItems=20, minItems=1) + type: Literal["REMEDIATION_UPDATE"] = "REMEDIATION_UPDATE" + """ + The categorized type of account update event from the Partner's system. + """ + + +class AccountScreenResponse( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountScreenResponse: Response for an account transaction provided by Expedia's Fraud Prevention Service.""" + risk_id: Optional[constr(max_length=200)] = Field(None, example="1234567") + """ + Unique identifier assigned to the transaction by Expedia's Fraud Prevention Service. + """ + decision: Optional[AccountTakeoverFraudDecision] = None + + +class AccountTakeoverCustomerAccount( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountTakeoverCustomerAccount: Information about a user's account.""" + user_id: constr(max_length=200) = None + """ + Unique account identifier provided by the Partner's Identity Provider/System assigned to the account owner by the partner. `user_id` is specific to the Partner's namespace. Used to track repeat account activity by the same user. + """ + account_type: AccountType1 = None + """ + Identifies the account type of a user''s account. Possible values are: + - `INDIVIDUAL` - Applicable if this account is for an individual traveler. + - `BUSINESS` - Applicable if this account is for a business or organization account used by suppliers or Partners. + + """ + account_role: Optional[AccountRole] = None + """ + Identifies the account role and associated permissions of a user''s account. Possible values are: + - `USER`: Basic account with no special privileges. + - `MANAGER`: Account with additional privileges, such as the ability to make bookings for others. + - `ADMIN`: Account with higher privileges than a manager, including the ability to grant manager access to other users. + + """ + name: Optional[AccountTakeoverName] = None + username: constr(max_length=200) = None + """ + Username of the account. + """ + email_address: EmailStr = None + """ + Email address for the account owner. + """ + telephones: Optional[list[Telephone]] = Field(None, maxItems=20) + address: Optional[Address] = None + registered_time: datetime = None + """ + The local date and time that the customer first registered on the Partner's site, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + """ + active_flag: bool = None + """ + Indicator for if this account is an active account or not. + """ + loyalty_member_id: Optional[constr(max_length=200)] = None + """ + Unique loyalty identifier for a user. + """ + + +class CurrentUserSession( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model CurrentUserSession: The current user session prior to this transaction, which contains details related to any challenge initiated by the Partner''s system to a user before calling Expedia''s Fraud Prevention Service. + An example is if the Partner''s system sent a Captcha challenge to the user before calling Expedia''s Fraud Prevention Service. + + """ + session_id: Optional[constr(max_length=200)] = None """ - Local date and time user validated possession of their phone number via a text or voice multi factor authentication challenge, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Unique identifier for a user's session on their device """ - verified_flag: Optional[bool] = None + start_date_time: Optional[datetime] = None """ - Flag indicating whether user passed validation of possession of their phone number via a text or voice multi factor authentication challenge. + The local date and time a user's session started, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ + challenge_detail: Optional[ChallengeDetail] = None class ChargebackFeedback( @@ -1932,12 +2002,7 @@ class ChargebackFeedback( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model ChargebackFeedback: Feedback from EG external partners if they receive a chargeback for a false negative recommendation from Fraud Prevention system. - Attributes: - chargeback_detail(Optional[ChargebackDetail], optional): -- - type(Literal['CHARGEBACK_FEEDBACK']): -- - - """ + r"""pydantic model ChargebackFeedback: Feedback from EG external partners if they receive a chargeback for a false negative recommendation from Fraud Prevention system.""" chargeback_detail: Optional[ChargebackDetail] = None type: Literal["CHARGEBACK_FEEDBACK"] = "CHARGEBACK_FEEDBACK" @@ -1947,12 +2012,7 @@ class IssuedRefundUpdate( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model IssuedRefundUpdate: Data related to the issued refund that should be updated. - Attributes: - refund_details(Optional[IssuedRefundUpdateDetails], optional): -- - refund_status(Literal['ISSUED']): Identifies the refund status. Possible values are: -`ISSUED` - The refund was issued. -`SETTLED` - The refund was settled. - - """ + r"""pydantic model IssuedRefundUpdate: Data related to the issued refund that should be updated.""" refund_details: Optional[IssuedRefundUpdateDetails] = None refund_status: Literal["ISSUED"] = "ISSUED" """ @@ -1968,12 +2028,7 @@ class SettledRefundUpdate( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model SettledRefundUpdate: Data related to the settled refund that should be updated. - Attributes: - refund_details(Optional[SettledRefundUpdateDetails], optional): -- - refund_status(Literal['SETTLED']): Identifies the refund status. Possible values are: -`ISSUED` - The refund was issued. -`SETTLED` - The refund was settled. - - """ + r"""pydantic model SettledRefundUpdate: Data related to the settled refund that should be updated.""" refund_details: Optional[SettledRefundUpdateDetails] = None refund_status: Literal["SETTLED"] = "SETTLED" """ @@ -1989,17 +2044,7 @@ class CustomerAccount( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model CustomerAccount - Attributes: - user_id(Optional[str], optional): Unique account identifier provided by the partner's Identity Provider/System assigned to the account owner by the partner. `user_id` is specific to the partner namespace. Used to track repeat purchases by the same user. - account_type(AccountType): Identifies if the customer account is known to the client. Possible values are: -`GUEST` - Applicable if the partner maintains record to distinguish whether the transaction was booked via a guest account. -`STANDARD` - Default account type. - name(Name): -- - email_address(EmailStr): Email address for the account owner. - telephones(Optional[list[Telephone]], optional): -- - address(Optional[Address], optional): -- - registered_time(Optional[datetime], optional): The local date and time that the customer first registered on the client site, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - - """ + r"""pydantic model CustomerAccount""" user_id: Optional[str] = None """ Unique account identifier provided by the partner's Identity Provider/System assigned to the account owner by the partner. `user_id` is specific to the partner namespace. Used to track repeat purchases by the same user. @@ -2022,7 +2067,7 @@ class CustomerAccount( address: Optional[Address] = None registered_time: Optional[datetime] = None """ - The local date and time that the customer first registered on the client site, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + The local date and time that the customer first registered on the client site, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ @@ -2031,18 +2076,7 @@ class Traveler( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Traveler - Attributes: - traveler_name(Name): -- - email_address(Optional[EmailStr], optional): Email address associated with the traveler as supplied by the partner system. - telephones(Optional[list[Telephone]], optional): -- - primary(bool): Indicator for one of the travelers who is the primary traveler. One traveler in each itinerary item must be listed as primary. By default, for a single traveler this should be set to `true`. - age(Optional[float], optional): Age of the traveler. - birth_date(Optional[datetime], optional): Date of birth for traveler, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - citizenship_country_code(Optional[constr(regex=r'^[A-Z]{3}$', min_length=3, max_length=3)], optional): The alpha-3 ISO country code of the traveler's nationality. - traveler_id(Optional[constr(max_length=100)], optional): A unique identifier for travelers in the transaction. - - """ + r"""pydantic model Traveler""" traveler_name: Name = None email_address: Optional[EmailStr] = None """ @@ -2059,7 +2093,7 @@ class Traveler( """ birth_date: Optional[datetime] = None """ - Date of birth for traveler, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Date of birth for traveler, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ citizenship_country_code: Optional[constr(regex=r"^[A-Z]{3}$", min_length=3, max_length=3)] = None """ @@ -2076,13 +2110,7 @@ class Rail( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Rail - Attributes: - route_type(RouteType): The type of route or itinerary for the Rail product, indicating the travel arrangement and pattern. Possible values are: - `MULTIPLE_DESTINATIONS` - The Rail product includes multiple destinations in its itinerary. - `ONE_WAY` - The Rail product represents a one-way journey. - `ROUNDTRIP` - The Rail product represents a roundtrip journey. - rail_segments(list[RailSegments]): -- - type(Literal['RAIL']): -- - - """ + r"""pydantic model Rail""" route_type: RouteType = None """ The type of route or itinerary for the Rail product, indicating the travel arrangement and pattern. Possible values are: @@ -2100,28 +2128,116 @@ class PaymentOperation( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model PaymentOperation - Attributes: - id(Optional[constr(max_length=200)], optional): -- - amount(Optional[Amount], optional): -- - outcome(Optional[PaymentOutcome], optional): -- - - """ + r"""pydantic model PaymentOperation""" id: Optional[constr(max_length=200)] = None amount: Optional[Amount] = None outcome: Optional[PaymentOutcome] = None -class Verify( - PaymentOperation, +class MultiFactorAuthenticationUpdate( + AccountUpdateRequestGeneric, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model MultiFactorAuthenticationUpdate: Information specific to a user's response to a Multi-Factor Authentication initiated by the Partner's system as a result of a fraud recommendation.""" + multi_factor_authentication_attempts: list[MultiFactorAuthenticationAttempt] = Field(..., maxItems=20, minItems=1) + type: Literal["MULTI_FACTOR_AUTHENTICATION_UPDATE"] = "MULTI_FACTOR_AUTHENTICATION_UPDATE" + """ + The categorized type of account update event from the Partner's system. + """ + + +class AccountTakeoverTransactionDetailsGeneric( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountTakeoverTransactionDetails: The `transaction_type` field value is used as a discriminator, with the following mapping: + * `LOGIN`: `LoginTransactionDetails` + + """ + type: Type3 = None + """ + The categorized type of account event related to a user's action. + """ + transaction_date_time: datetime = None + """ + The local date and time the transaction occured in the Partner's system, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + """ + transaction_id: constr(max_length=200) = None + """ + Unique identifier to identify a transaction attempt in the Partner's system. + """ + current_user_session: Optional[CurrentUserSession] = None + + +class LoginTransactionDetails( + AccountTakeoverTransactionDetailsGeneric, smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Verify: A verify operation represents the intent to verify the payment associated with this transaction. - Attributes: - type(Optional[VerificationType], optional): -- + r"""pydantic model LoginTransactionDetails""" + authentication_type: AuthenticationType = None + """ + The type of login authentication method used by a user. + For `authentication_type` ensure attributes mentioned in dictionary below are set to corresponding values only. + `authentication_type` is an enum value with the following mapping with `authentication_sub_type` attribute: + * authentication_type : authentication_sub_type + * ------------------------------------------------------------------------------- + * `CREDENTIALS` : `EMAIL` + * `CREDENTIALS` : + * `PASSWORD_RESET` : `EMAIL` + * `SINGLE_SIGN_ON` : `EMAIL` + * `MULTI_FACTOR_AUTHENTICATION` : `EMAIL` + * `MULTI_FACTOR_AUTHENTICATION` : `PHONE` + * `SOCIAL` : `GOOGLE` + * `SOCIAL` : `FACEBOOK` + * `SOCIAL` : `APPLE` + + """ + authentication_sub_type: Optional[AuthenticationSubType] = None + """ + The sub type of login authentication method used by a user. + For `authentication_sub_type` ensure attributes mentioned in dictionary below are set to corresponding values only. + `authentication_sub_type` is an enum value with the following mapping with `authentication_type` attribute: + * authentication_sub_type : authentication_type + * ------------------------------------------------------------------------------- + * `EMAIL` : `CREDENTIALS` + * `EMAIL` : `PASSWORD_RESET` + * `EMAIL` : `SINGLE_SIGN_ON` + * `EMAIL` : `MULTI_FACTOR_AUTHENTICATION` + * `PHONE` : `MULTI_FACTOR_AUTHENTICATION` + * `GOOGLE` : `SOCIAL` + * `FACEBOOK` : `SOCIAL` + * `APPLE` : `SOCIAL` + * : `CREDENTIALS` + + """ + successful_login_flag: bool = None + """ + Identifies if a login attempt by a user was successful or not. + """ + failed_login_reason: Optional[FailedLoginReason] = None + """ + The reason for the failed login attempt in the Partner''s system, related to user failure or Partner''s system failure. + - `INVALID_CREDENTIALS` - Applicable if the user provided invalid login credentials for this login attempt. + - `ACCOUNT_NOT_FOUND` - Applicable if the user attempted to login to an account that doesn't exist. + - `VERIFICATION_FAILED` - Applicable if the user failed the verification for this login, or any authentication exception occured in the Partner system for this login attempt. + - `ACCOUNT_LOCKED` - Applicable if the user attempted to login to an account that is locked. """ + type: Literal["LOGIN"] = "LOGIN" + """ + The categorized type of account event related to a user's action. + """ + + +class Verify( + PaymentOperation, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model Verify: A verify operation represents the intent to verify the payment associated with this transaction.""" type: Optional[VerificationType] = None @@ -2161,6 +2277,18 @@ class Refund( pass +class AccountTransaction( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountTransaction: Information for an account transaction.""" + site_info: AccountTakeoverSiteInfo = None + device_details: AccountTakeoverDeviceDetails = None + customer_account: AccountTakeoverCustomerAccount = None + transaction_details: AccountTakeoverTransactionDetails = None + + class Operations( BaseModel, smart_union=True, @@ -2178,13 +2306,6 @@ class Operations( - `Refund` - Attributes: - verify(Optional[Verify], optional): -- - authorize(Optional[Authorize], optional): -- - authorize_reversal(Optional[AuthorizeReversal], optional): -- - capture(Optional[Capture], optional): -- - refunds(Optional[list[Refund]], optional): -- - """ verify: Optional[Verify] = None authorize: Optional[Authorize] = None @@ -2193,6 +2314,15 @@ class Operations( refunds: Optional[list[Refund]] = Field(None, maxItems=20) +class AccountScreenRequest( + BaseModel, + smart_union=True, + extra=Extra.forbid, +): + r"""pydantic model AccountScreenRequest: Information for account screening by Expedia's Fraud Prevention Service.""" + transaction: AccountTransaction = None + + class PaymentGeneric( BaseModel, smart_union=True, @@ -2206,18 +2336,6 @@ class PaymentGeneric( * `INTERNET_BANK_PAYMENT`: `InternetBankPayment` * `DIRECT_DEBIT`: `DirectDebit` - Attributes: - brand(Brand): The `brand` field value is the payment brand used for payment on this transaction. For credit card payment method ensure attributes mentioned in dictionary below are set to corresponding values only. Ensure to comply with the naming standards provided in below dictionary. For example, some Payment processors use “Japan Credit Bureau” but “JCB” should be used when calling Fraud API. Incorrect `brand` - `card_type` combination will result in data quality issues and result in degraded risk recommendation. 'brand' is an enum value with the following mapping with CreditCard 'card_type' attribute: * brand : card_type * ------------------------------------------------------- * `AMERICAN_EXPRESS` : `AMERICAN_EXPRESS` * `DINERS_CLUB_INTERNATIONAL` : `DINERS_CLUB` * `BC_CARD` : `DINERS_CLUB` * `DISCOVER` : `DISCOVER` * `BC_CARD` : `DISCOVER` * `DINERS_CLUB_INTERNATIONAL` : `DISCOVER` * `JCB` : `DISCOVER` * `JCB` : `JCB` * `MASTER_CARD` : `MASTER_CARD` * `MAESTRO` : `MASTER_CARD` * `POSTEPAY_MASTERCARD` : `MASTER_CARD` * `SOLO` : `SOLO` * `SWITCH` : `SWITCH` * `MAESTRO` : `MAESTRO` * `CHINA_UNION_PAY` : `CHINA_UNION_PAY` * `VISA` : `VISA` * `VISA_DELTA` : `VISA` * `VISA_ELECTRON` : `VISA` * `CARTA_SI` : `VISA` * `CARTE_BLEUE` : `VISA` * `VISA_DANKORT` : `VISA` * `POSTEPAY_VISA_ELECTRON` : `VISA` * `PAYPAL` : 'brand' with 'Points' payment_type is an enum value with following: * `EXPEDIA_REWARDS` * `AMEX_POINTS` * `BANK_OF_AMERICA_REWARDS` * `DISCOVER_POINTS` * `MASTER_CARD_POINTS` * `CITI_THANK_YOU_POINTS` * `MERRILL_LYNCH_REWARDS` * `WELLS_FARGO_POINTS` * `DELTA_SKY_MILES` * `UNITED_POINTS` * `DISCOVER_MILES` * `ALASKA_MILES` * `RBC_REWARDS` * `BILT_REWARDS` * `ORBUCKS` * `CHEAP_CASH` * `BONUS_PLUS` * `ULTIMATE_REWARDS` 'brand' with 'GiftCard' payment_type is an enum value with following: * `GIFT_CARD` 'brand' with 'InternetBankPayment' payment_type is an enum value with following: * `IBP` * `LOCAL_DEBIT_CARD` * `SOFORT` * `YANDEX` * `WEB_MONEY` * `QIWI` * `BITCOIN` 'brand' with 'DirectDebit' payment_type is an enum value with following: * `ELV` * `INTER_COMPANY` - method(PaymentMethod): -- - reason(Optional[PaymentReason], optional): -- - billing_name(Name): -- - billing_address(Address): -- - billing_email_address(EmailStr): Email address associated with the payment. - authorized_amount(Optional[Amount], optional): -- - verified_amount(Optional[Amount], optional): -- - three_digits_secure_criteria(Optional[PaymentThreeDSCriteria], optional): -- - operations(Optional[Operations], optional): -- - """ brand: Brand = None """ @@ -2308,22 +2426,7 @@ class CreditCard( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model CreditCard - Attributes: - card_type(CardType): The 'card_type' field value is an enum value which is associated with the payment method of the specific payment instrument. For credit card payment method ensure attributes mentioned in dictionary below are set to corresponding values only. Ensure to comply with the naming standards provided in below dictionary. For example, some Payment processors use “Japan Credit Bureau” but “JCB” should be used when calling Fraud API. Incorrect `card_type` - `brand` combination will result in data quality issues and result in degraded risk recommendation. 'card_type' is an enum value with the following mapping with Payment `brand` attribute: * card_type : brand * -------------------------------------------------------- * `AMERICAN_EXPRESS` : `AMERICAN_EXPRESS` * `DINERS_CLUB` : `DINERS_CLUB_INTERNATIONAL` * `DINERS_CLUB` : `BC_CARD` * `DISCOVER` : `DISCOVER` * `DISCOVER` : `BC_CARD` * `DISCOVER` : `DINERS_CLUB_INTERNATIONAL` * `DISCOVER` : `JCB` * `JCB` : `JCB` * `MASTER_CARD` : `MASTER_CARD` * `MASTER_CARD` : `MAESTRO` * `MASTER_CARD` : `POSTEPAY_MASTERCARD` * `SOLO` : `SOLO` * `SWITCH` : `SWITCH` * `MAESTRO` : `MAESTRO` * `CHINA_UNION_PAY` : `CHINA_UNION_PAY` * `VISA` : `VISA` * `VISA` : `VISA_DELTA` * `VISA` : `VISA_ELECTRON` * `VISA` : `CARTA_SI` * `VISA` : `CARTE_BLEUE` * `VISA` : `VISA_DANKORT` * `VISA` : `POSTEPAY_VISA_ELECTRON` - card_number(constr(max_length=200)): All the digits (unencrypted) of the credit card number associated with the payment. - expiry_date(datetime): Expiration date of the credit card used for payment, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. - electronic_commerce_indicator(Optional[constr(max_length=200)], optional): Electronic Commerce Indicator, a two or three digit number usually returned by a 3rd party payment processor in regards to the authentication used when gathering the cardholder's payment credentials. - virtual_credit_card_flag(Optional[bool], optional): A flag to indicate that the bank card being used for the charge is a virtual credit card. - wallet_type(Optional[constr(max_length=200)], optional): If a virtual/digital form of payment was used, the type of digital wallet should be specified here. Possible `wallet_type`'s include: `Google` or `ApplePay`. - card_avs_response(Optional[constr(max_length=50)], optional): A field used to confirm if the address provided at the time of purchase matches what the bank has on file for the Credit Card. - card_cvv_response(Optional[constr(max_length=20)], optional): A field used to confirm the Card Verification Value on the Credit Card matches the Credit Card used at the time of purchase. - telephones(list[Telephone]): Telephone(s) associated with card holder and credit card. - merchant_order_code(Optional[constr(max_length=200)], optional): Reference code passed to acquiring bank at the time of payment. This code is the key ID that ties back to payments data at the payment level. - card_authentication_failure_count(Optional[int], optional): Total authentication failure count for given card. - method(Literal['CREDIT_CARD']): -- - - """ + r"""pydantic model CreditCard""" card_type: CardType = None """ The 'card_type' field value is an enum value which is associated with the payment method of the specific payment instrument. @@ -2363,7 +2466,7 @@ class CreditCard( """ expiry_date: datetime = None """ - Expiration date of the credit card used for payment, in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + Expiration date of the credit card used for payment, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. """ electronic_commerce_indicator: Optional[constr(max_length=200)] = None """ @@ -2405,14 +2508,7 @@ class PayPal( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model PayPal - Attributes: - payer_id(constr(max_length=200)): Unique PayPal Customer Account identification number. - transaction_id(constr(max_length=200)): Unique transaction number to identify Auth calls at PayPal. - merchant_order_code(Optional[constr(max_length=200)], optional): Reference code passed to acquiring bank at the time of payment. This code is the key ID that ties back to payments data at the payment level. - method(Literal['PAYPAL']): -- - - """ + r"""pydantic model PayPal""" payer_id: constr(max_length=200) = None """ Unique PayPal Customer Account identification number. @@ -2433,12 +2529,7 @@ class Points( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model Points - Attributes: - account_id(constr(max_length=200)): Points account id. - method(Literal['POINTS']): -- - - """ + r"""pydantic model Points""" account_id: constr(max_length=200) = None """ Points account id. @@ -2451,14 +2542,7 @@ class GiftCard( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model GiftCard - Attributes: - card_number(constr(regex=r'^[0-9A-Za-z]{4,16}$', max_length=16)): Gift card number. - card_holder_name(constr(max_length=200)): The name of gift card holder. - pin(constr(regex=r'^[0-9]{4,8}$', max_length=8)): The PIN of gift card. - method(Literal['GIFT_CARD']): -- - - """ + r"""pydantic model GiftCard""" card_number: constr(regex=r"^[0-9A-Za-z]{4,16}$", max_length=16) = Field(..., example="123456ABCDabcd") """ Gift card number. @@ -2479,14 +2563,7 @@ class InternetBankPayment( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model InternetBankPayment - Attributes: - bank_id(constr(max_length=15)): The bank_id provided by the internet bank payment(IBP) provider (DRWP aka NetGiro) for the bank used for processing the payment. - bank_branch_code(constr(max_length=15)): A code that identifies the bank branch for internet bank payment(IBP). - telephones(list[Telephone]): Telephone(s) associated with internet bank payment(IBP) provider. - method(Literal['INTERNET_BANK_PAYMENT']): -- - - """ + r"""pydantic model InternetBankPayment""" bank_id: constr(max_length=15) = None """ The bank_id provided by the internet bank payment(IBP) provider (DRWP aka NetGiro) for the bank used for processing the payment. @@ -2507,14 +2584,7 @@ class DirectDebit( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model DirectDebit - Attributes: - routing_number(constr(max_length=15)): A code that identifies the financial institution for a specific bank account. - account_number(constr(max_length=100)): Cleartext (unencrypted) DirectDebit bank account number associated with the payment instrument. - telephones(list[Telephone]): Telephone(s) associated with direct debit payment provider. - method(Literal['DIRECT_DEBIT']): -- - - """ + r"""pydantic model DirectDebit""" routing_number: constr(max_length=15) = Field(..., example="100000000") """ A code that identifies the financial institution for a specific bank account. @@ -2535,16 +2605,7 @@ class TransactionDetails( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model TransactionDetails - Attributes: - order_id(constr(max_length=50)): Unique identifier assigned to the order by the partner. `order_id` is specific to the partner namespace. - current_order_status(CurrentOrderStatus): Status of the order: * `IN_PROGRESS` is used when order has not processed fully. For example, inventory has not yet been reserved, or payment has not yet been settled. * `COMPLETED` is used when an order has been processed fully. For example, inventory has been reserved, and the payment has been settled. - order_type(OrderType): Type of order. Possible `order_types`. `CREATE` - Initial type of a brand new order. `CHANGE` - If a `OrderPurchaseScreenRequest` has already been submitted for the initial booking with `order_type = CREATE`, but has now been modified and partner wishes to resubmit for Fraud screening then the `order_type = CHANGE`. Examples of changes that are supported are changes made to `check-in/checkout dates` or `price of a TravelProduct`. - travel_products(list[TravelProduct]): -- - travelers(list[Traveler]): Individuals who are part of the travel party for the order. At minimum there must be at least `1` traveler. - payments(list[Payment]): List of the form(s) of payment being used to purchase the order. One or more forms of payment can be used within an order. Information gathered will be specific to the form of payment. - - """ + r"""pydantic model TransactionDetails""" order_id: constr(max_length=50) = Field(..., example="1000000234") """ Unique identifier assigned to the order by the partner. `order_id` is specific to the partner namespace. @@ -2570,7 +2631,7 @@ class TransactionDetails( """ Individuals who are part of the travel party for the order. At minimum there must be at least `1` traveler. """ - payments: list[Payment] = Field(..., maxItems=30, minItems=1) + payments: Optional[list[Payment]] = Field(None, maxItems=30, minItems=1) """ List of the form(s) of payment being used to purchase the order. One or more forms of payment can be used within an order. Information gathered will be specific to the form of payment. """ @@ -2581,14 +2642,7 @@ class OrderPurchaseTransaction( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model OrderPurchaseTransaction - Attributes: - site_info(SiteInfo): -- - device_details(DeviceDetails): -- - customer_account(CustomerAccount): -- - transaction_details(TransactionDetails): -- - - """ + r"""pydantic model OrderPurchaseTransaction""" site_info: SiteInfo = None device_details: DeviceDetails = None customer_account: CustomerAccount = None @@ -2600,51 +2654,36 @@ class OrderPurchaseScreenRequest( smart_union=True, extra=Extra.forbid, ): - r"""pydantic model OrderPurchaseScreenRequest - Attributes: - transaction(Optional[OrderPurchaseTransaction], optional): -- - - """ - transaction: Optional[OrderPurchaseTransaction] = None + r"""pydantic model OrderPurchaseScreenRequest""" + transaction: OrderPurchaseTransaction = None RefundUpdate = Union[IssuedRefundUpdate, SettledRefundUpdate, RefundUpdateGeneric] OrderPurchaseUpdateRequest = Union[OrderUpdate, ChargebackFeedback, InsultFeedback, RefundUpdate, PaymentUpdate, OrderPurchaseUpdateRequestGeneric] -TravelProduct = Union[Rail, Activities, Air, Cruise, Car, Hotel, Insurance, TravelProductGeneric] +TravelProduct = Union[Rail, Air, Cruise, Car, Hotel, Insurance, TravelProductGeneric] Payment = Union[CreditCard, PayPal, Points, GiftCard, InternetBankPayment, DirectDebit, PaymentGeneric] +AccountUpdateRequest = Union[MultiFactorAuthenticationUpdate, RemediationUpdate, AccountUpdateRequestGeneric] -Error.update_forward_refs() - - -UnauthorizedError.update_forward_refs() +AccountTakeoverTransactionDetails = Union[LoginTransactionDetails, AccountTakeoverTransactionDetailsGeneric] -ForbiddenError.update_forward_refs() +Error.update_forward_refs() -NotFoundError.update_forward_refs() +UnauthorizedError.update_forward_refs() OrderPurchaseUpdateNotFoundError.update_forward_refs() -TooManyRequestsError.update_forward_refs() - - -InternalServerError.update_forward_refs() - - -BadGatewayError.update_forward_refs() - - -ServiceUnavailableError.update_forward_refs() +RetryableOrderPurchaseScreenFailure.update_forward_refs() -GatewayTimeoutError.update_forward_refs() +RetryableOrderPurchaseUpdateFailure.update_forward_refs() Cause.update_forward_refs() @@ -2680,34 +2719,76 @@ class OrderPurchaseScreenRequest( RailwayStationDetails.update_forward_refs() -Activity.update_forward_refs() +AirSegment.update_forward_refs() -Coordinates.update_forward_refs() +HotelAddress.update_forward_refs() -OperatingCompanyModel.update_forward_refs() +PaymentThreeDSCriteria.update_forward_refs() -Ticket.update_forward_refs() +Name.update_forward_refs() -AirSegment.update_forward_refs() +Email.update_forward_refs() -HotelAddress.update_forward_refs() +Amount.update_forward_refs() -PaymentThreeDSCriteria.update_forward_refs() +AccountTakeoverError.update_forward_refs() -Name.update_forward_refs() +AccountTakeoverUnauthorizedError.update_forward_refs() -Email.update_forward_refs() +AccountUpdateNotFoundError.update_forward_refs() -Amount.update_forward_refs() +ServiceUnavailableError.update_forward_refs() + + +Cause1.update_forward_refs() + + +AccountTakeoverBadRequestError.update_forward_refs() + + +RemediationUpdateAction.update_forward_refs() + + +AccountUpdateResponse.update_forward_refs() + + +AccountTakeoverSiteInfo.update_forward_refs() + + +AccountTakeoverDeviceDetails.update_forward_refs() + + +AccountTakeoverName.update_forward_refs() + + +ChallengeDetail.update_forward_refs() + + +ForbiddenError.update_forward_refs() + + +NotFoundError.update_forward_refs() + + +TooManyRequestsError.update_forward_refs() + + +InternalServerError.update_forward_refs() + + +BadGatewayError.update_forward_refs() + + +GatewayTimeoutError.update_forward_refs() OrderUpdate.update_forward_refs() @@ -2734,9 +2815,6 @@ class OrderPurchaseScreenRequest( RailSegments.update_forward_refs() -Activities.update_forward_refs() - - Air.update_forward_refs() @@ -2758,6 +2836,21 @@ class OrderPurchaseScreenRequest( Telephone.update_forward_refs() +MultiFactorAuthenticationAttempt.update_forward_refs() + + +RemediationUpdate.update_forward_refs() + + +AccountScreenResponse.update_forward_refs() + + +AccountTakeoverCustomerAccount.update_forward_refs() + + +CurrentUserSession.update_forward_refs() + + ChargebackFeedback.update_forward_refs() @@ -2779,6 +2872,12 @@ class OrderPurchaseScreenRequest( PaymentOperation.update_forward_refs() +MultiFactorAuthenticationUpdate.update_forward_refs() + + +LoginTransactionDetails.update_forward_refs() + + Verify.update_forward_refs() @@ -2794,9 +2893,15 @@ class OrderPurchaseScreenRequest( Refund.update_forward_refs() +AccountTransaction.update_forward_refs() + + Operations.update_forward_refs() +AccountScreenRequest.update_forward_refs() + + CreditCard.update_forward_refs() @@ -2822,3 +2927,168 @@ class OrderPurchaseScreenRequest( OrderPurchaseScreenRequest.update_forward_refs() + + +class ExpediaGroupRetryableOrderPurchaseScreenFailureException(ExpediaGroupApiException): + r"""Exception wrapping a RetryableOrderPurchaseScreenFailure object.""" + pass + + +class ExpediaGroupNotFoundErrorException(ExpediaGroupApiException): + r"""Exception wrapping a NotFoundError object.""" + pass + + +class ExpediaGroupOrderPurchaseUpdateNotFoundErrorException(ExpediaGroupApiException): + r"""Exception wrapping a OrderPurchaseUpdateNotFoundError object.""" + pass + + +class ExpediaGroupInternalServerErrorException(ExpediaGroupApiException): + r"""Exception wrapping a InternalServerError object.""" + pass + + +class ExpediaGroupAccountTakeoverBadRequestErrorException(ExpediaGroupApiException): + r"""Exception wrapping a AccountTakeoverBadRequestError object.""" + pass + + +class ExpediaGroupUnauthorizedErrorException(ExpediaGroupApiException): + r"""Exception wrapping a UnauthorizedError object.""" + pass + + +class ExpediaGroupGatewayTimeoutErrorException(ExpediaGroupApiException): + r"""Exception wrapping a GatewayTimeoutError object.""" + pass + + +class ExpediaGroupServiceUnavailableErrorException(ExpediaGroupApiException): + r"""Exception wrapping a ServiceUnavailableError object.""" + pass + + +class ExpediaGroupForbiddenErrorException(ExpediaGroupApiException): + r"""Exception wrapping a ForbiddenError object.""" + pass + + +class ExpediaGroupAccountUpdateNotFoundErrorException(ExpediaGroupApiException): + r"""Exception wrapping a AccountUpdateNotFoundError object.""" + pass + + +class ExpediaGroupTooManyRequestsErrorException(ExpediaGroupApiException): + r"""Exception wrapping a TooManyRequestsError object.""" + pass + + +class ExpediaGroupBadGatewayErrorException(ExpediaGroupApiException): + r"""Exception wrapping a BadGatewayError object.""" + pass + + +class ExpediaGroupBadRequestErrorException(ExpediaGroupApiException): + r"""Exception wrapping a BadRequestError object.""" + pass + + +class ExpediaGroupRetryableOrderPurchaseUpdateFailureException(ExpediaGroupApiException): + r"""Exception wrapping a RetryableOrderPurchaseUpdateFailure object.""" + pass + + +class ExpediaGroupAccountTakeoverUnauthorizedErrorException(ExpediaGroupApiException): + r"""Exception wrapping a AccountTakeoverUnauthorizedError object.""" + pass + + +@dataclass +class RetryableOrderPurchaseScreenFailureDeserializationContract: + exception: type = ExpediaGroupRetryableOrderPurchaseScreenFailureException + model: type = RetryableOrderPurchaseScreenFailure + + +@dataclass +class NotFoundErrorDeserializationContract: + exception: type = ExpediaGroupNotFoundErrorException + model: type = NotFoundError + + +@dataclass +class OrderPurchaseUpdateNotFoundErrorDeserializationContract: + exception: type = ExpediaGroupOrderPurchaseUpdateNotFoundErrorException + model: type = OrderPurchaseUpdateNotFoundError + + +@dataclass +class InternalServerErrorDeserializationContract: + exception: type = ExpediaGroupInternalServerErrorException + model: type = InternalServerError + + +@dataclass +class AccountTakeoverBadRequestErrorDeserializationContract: + exception: type = ExpediaGroupAccountTakeoverBadRequestErrorException + model: type = AccountTakeoverBadRequestError + + +@dataclass +class UnauthorizedErrorDeserializationContract: + exception: type = ExpediaGroupUnauthorizedErrorException + model: type = UnauthorizedError + + +@dataclass +class GatewayTimeoutErrorDeserializationContract: + exception: type = ExpediaGroupGatewayTimeoutErrorException + model: type = GatewayTimeoutError + + +@dataclass +class ServiceUnavailableErrorDeserializationContract: + exception: type = ExpediaGroupServiceUnavailableErrorException + model: type = ServiceUnavailableError + + +@dataclass +class ForbiddenErrorDeserializationContract: + exception: type = ExpediaGroupForbiddenErrorException + model: type = ForbiddenError + + +@dataclass +class AccountUpdateNotFoundErrorDeserializationContract: + exception: type = ExpediaGroupAccountUpdateNotFoundErrorException + model: type = AccountUpdateNotFoundError + + +@dataclass +class TooManyRequestsErrorDeserializationContract: + exception: type = ExpediaGroupTooManyRequestsErrorException + model: type = TooManyRequestsError + + +@dataclass +class BadGatewayErrorDeserializationContract: + exception: type = ExpediaGroupBadGatewayErrorException + model: type = BadGatewayError + + +@dataclass +class BadRequestErrorDeserializationContract: + exception: type = ExpediaGroupBadRequestErrorException + model: type = BadRequestError + + +@dataclass +class RetryableOrderPurchaseUpdateFailureDeserializationContract: + exception: type = ExpediaGroupRetryableOrderPurchaseUpdateFailureException + model: type = RetryableOrderPurchaseUpdateFailure + + +@dataclass +class AccountTakeoverUnauthorizedErrorDeserializationContract: + exception: type = ExpediaGroupAccountTakeoverUnauthorizedErrorException + model: type = AccountTakeoverUnauthorizedError diff --git a/release/fraudPreventionV2/setup.py b/release/fraudPreventionV2/setup.py index fe28962e..7ccc4ab1 100644 --- a/release/fraudPreventionV2/setup.py +++ b/release/fraudPreventionV2/setup.py @@ -16,14 +16,14 @@ from setuptools import setup setup( - name="openworld-sdk-python-fraudpreventionv2", - version="1.4.0", - packages=["openworld.sdk.fraudpreventionv2"], - package_dir={"openworld-sdk-python-fraudpreventionv2": "."}, + name="expediagroup-fraudpreventionv2-sdk", + version="2.1.0", + packages=["expediagroup-fraudpreventionv2-sdk"], + package_dir={"expediagroup-fraudpreventionv2-sdk": "."}, license="Apache License, Version 2.0", author="Expedia Group", author_email="oss@expediagroup.com", - url="https://github.com/ExpediaGroup/openworld-sdk-python", + url="https://github.com/ExpediaGroup/expediagroup-python-sdk", classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python", @@ -36,7 +36,7 @@ "License :: OSI Approved :: MIT License", ], python_requires=">=3.8", - install_requires=["uri", "furl", "openworld-sdk-python-core", "pydantic", "pydantic[email]", "email-validator"], - description="Open World Fraud Prevention V2 SDK for Python", - long_description="Open World Fraud Prevention V2 SDK for Python", + install_requires=["uri", "furl", "expediagroup-sdk-python-core", "pydantic", "pydantic[email]", "email-validator"], + description="Expedia Group Fraud Prevention V2 SDK for Python", + long_description="Expedia Group Fraud Prevention V2 SDK for Python", ) diff --git a/release/fraudPreventionV2/specs.yaml b/release/fraudPreventionV2/specs.yaml index 31b0b1e4..22149310 100644 --- a/release/fraudPreventionV2/specs.yaml +++ b/release/fraudPreventionV2/specs.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: 3.0.3 info: title: Fraud Prevention Service version: v2 @@ -9,12 +9,16 @@ info: x-eg-lifecycle: PLANNED servers: - url: https://api.expediagroup.com/fraud-prevention/v2 + - url: https://api.sandbox.expediagroup.com/fraud-prevention/v2 + - url: https://test-api.expediagroup.com/fraud-prevention/v2 + - url: https://test-api.sandbox.expediagroup.com/fraud-prevention/v2 tags: - name: fraudPreventionV2 paths: /fraud-prevention/v2/order/purchase/screen: post: tags: + &a1 - fraudPreventionV2 description: "The Order Purchase API gives a Fraud recommendation for a transaction. A recommendation can be Accept, Reject, or Review. A @@ -22,7 +26,7 @@ paths: to recommend Accept or Reject. These incidents are manually reviewed, and a corrected recommendation is made asynchronously. " summary: Run fraud screening for one transaction - operationId: screen + operationId: screenOrder security: - orderPurchaseScreenAuth: - fraudandrisk.stub.order-purchase-screen @@ -83,11 +87,11 @@ paths: schema: $ref: "#/components/schemas/BadGatewayError" "503": - description: Service unavailable + description: Retryable Order Purchase Screen Failure content: application/json: schema: - $ref: "#/components/schemas/ServiceUnavailableError" + $ref: "#/components/schemas/RetryableOrderPurchaseScreenFailure" "504": description: Gateway timeout content: @@ -96,8 +100,7 @@ paths: $ref: "#/components/schemas/GatewayTimeoutError" /fraud-prevention/v2/order/purchase/update: post: - tags: - - fraudPreventionV2 + tags: *a1 description: > The Order Purchase Update API is called when the status of the order has changed. @@ -108,7 +111,7 @@ paths: The Order Purchase Update API is also called when the merchant cancels or changes an order based on a Fraud recommendation. summary: Send an update for a transaction - operationId: update + operationId: notifyWithOrderUpdate security: - orderPurchaseUpdateAuth: - fraudandrisk.stub.order-purchase-update @@ -217,6 +220,199 @@ paths: application/json: schema: $ref: "#/components/schemas/BadGatewayError" + "503": + description: Retryable Order Purchase Update Failure + content: + application/json: + schema: + $ref: "#/components/schemas/RetryableOrderPurchaseUpdateFailure" + "504": + description: Gateway timeout + content: + application/json: + schema: + $ref: "#/components/schemas/GatewayTimeoutError" + /fraud-prevention/v2/account/screen: + post: + tags: *a1 + description: The Account Screen API gives a Fraud recommendation for an account + transaction. A recommendation can be ACCEPT, CHALLENGE, or REJECT. A + transaction is marked as CHALLENGE whenever there are insufficient + signals to recommend ACCEPT or REJECT. These CHALLENGE incidents are + manually reviewed, and a corrected recommendation is made + asynchronously. + summary: Run fraud screening for one transaction + operationId: screenAccount + security: + - accountScreenAuth: + - fraudandrisk.stub.account-screen + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AccountScreenRequest" + responses: + "200": + description: The AccountScreenRequest was successfully received and the account + screening is complete. + content: + application/json: + schema: + $ref: "#/components/schemas/AccountScreenResponse" + "400": + description: Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/AccountTakeoverBadRequestError" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/AccountTakeoverUnauthorizedError" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/ForbiddenError" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/NotFoundError" + "429": + description: Too many requests + content: + application/json: + schema: + $ref: "#/components/schemas/TooManyRequestsError" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/InternalServerError" + "502": + description: Bad gateway + content: + application/json: + schema: + $ref: "#/components/schemas/BadGatewayError" + "503": + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceUnavailableError" + "504": + description: Gateway timeout + content: + application/json: + schema: + $ref: "#/components/schemas/GatewayTimeoutError" + /fraud-prevention/v2/account/update: + post: + tags: *a1 + description: The Account Update API is called when there is an account lifecycle + transition such as a challenge outcome, account restoration, or + remediation action completion. For example, if a user's account is + disabled, deleted, or restored, the Account Update API is called to + notify Expedia Group about the change. The Account Update API is also + called when a user responds to a login Multi-Factor Authentication based + on a Fraud recommendation. + summary: Send an update as a result of an account screen transaction + operationId: notifyWithAccountUpdate + security: + - accountUpdateAuth: + - fraudandrisk.stub.account-update + requestBody: + required: true + description: An AccountUpdate request may be of one of the following types + `MULTI_FACTOR_AUTHENTICATION_UPDATE`, `REMEDIATION_UPDATE`. + content: + application/json: + schema: + $ref: "#/components/schemas/AccountUpdateRequest" + examples: + MultiFactorAuthenticationUpdate: + summary: Sample MultiFactorAuthenticationUpdate Request + value: + type: MULTI_FACTOR_AUTHENTICATION_UPDATE + risk_id: "1234324324" + multi_factor_authentication_attempts: + - delivery_method: SMS + status: SUCCESS + reference_id: "1234324324" + provider_name: DUO + attempt_count: 2 + update_start_date_time: 2022-07-24T01:01:01.111Z + update_end_date_time: 2022-07-24T01:02:01.111Z + telephone: + country_access_code: "1" + area_code: "234" + phone_number: "5678910" + RemediationUpdate: + summary: Sample RemediationUpdate Request + value: + type: REMEDIATION_UPDATE + risk_id: "1234324324" + remediation_update_actions: + - action_name: PASSWORD_RESET + status: SUCCESS + update_end_date_time: 2022-07-24T01:02:01.111Z + responses: + "200": + description: The AccountUpdateResponse was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/AccountUpdateResponse" + "400": + description: Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/AccountTakeoverBadRequestError" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/AccountTakeoverUnauthorizedError" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/ForbiddenError" + "404": + description: Account Update Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/AccountUpdateNotFoundError" + "429": + description: Too many requests + content: + application/json: + schema: + $ref: "#/components/schemas/TooManyRequestsError" + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/InternalServerError" + "502": + description: Bad gateway + content: + application/json: + schema: + $ref: "#/components/schemas/BadGatewayError" "503": description: Service unavailable content: @@ -282,7 +478,7 @@ components: code: FORBIDDEN message: Insufficient permissions to perform the request. allOf: - - $ref: "#/components/schemas/Error" + - $ref: "#/components/schemas/AccountTakeoverError" NotFoundError: description: Indicates that the API cannot find the resource that is either being requested or against which the operation is being performed. @@ -291,7 +487,7 @@ components: code: NOT_FOUND message: The requested resource does not exist. allOf: - - $ref: "#/components/schemas/Error" + - $ref: "#/components/schemas/AccountTakeoverError" OrderPurchaseUpdateNotFoundError: description: Indicates that the API cannot find the resource that is either being requested or against which the operation is being performed. @@ -314,7 +510,7 @@ components: message: The request failed because the server resources for this client have been exhausted. allOf: - - $ref: "#/components/schemas/Error" + - $ref: "#/components/schemas/AccountTakeoverError" InternalServerError: description: Indicates that the API encountered an unexpected condition that prevented it from fulfilling the request. Sometimes used as a generic @@ -325,7 +521,7 @@ components: code: INTERNAL_SERVER_ERROR message: The server encountered an internal error. allOf: - - $ref: "#/components/schemas/Error" + - $ref: "#/components/schemas/AccountTakeoverError" BadGatewayError: description: Indicates that the server received an invalid response from the upstream server. Causes could be incorrectly configured target server at @@ -335,8 +531,8 @@ components: code: BAD_GATEWAY message: The server received an invalid response from an upstream server. allOf: - - $ref: "#/components/schemas/Error" - ServiceUnavailableError: + - $ref: "#/components/schemas/AccountTakeoverError" + RetryableOrderPurchaseScreenFailure: description: > Indicates that the API is either down for maintenance or overloaded and cannot fulfill the request at the current time. This is a temporary @@ -350,6 +546,20 @@ components: using the same order details. allOf: - $ref: "#/components/schemas/Error" + RetryableOrderPurchaseUpdateFailure: + description: > + Indicates that the API is either down for maintenance or overloaded and + cannot fulfill the request at the current time. This is a temporary + error and retrying the same request after a certain delay could + eventually result in success. + + There will be a Retry-After HTTP header in API response specifying how long to wait to retry the request. If there is no Retry-After HTTP header then retry can happen immediately. If the error persists after retrying with delay, please reach out to ." + example: + code: RETRYABLE_ORDER_PURCHASE_UPDATE_FAILURE + message: A temporary internal error occurred. You can safely retry your call + using the same order details. + allOf: + - $ref: "#/components/schemas/Error" GatewayTimeoutError: description: Indicates that the API gateway has issues completing the request on time. Request can be retried if it is idempotent, If the issue persists, @@ -360,7 +570,7 @@ components: code: GATEWAY_TIMEOUT message: The server timed out while trying to complete the request. allOf: - - $ref: "#/components/schemas/Error" + - $ref: "#/components/schemas/AccountTakeoverError" BadRequestError: description: Indicates that a bad request occurred. Typically it is an invalid parameter. @@ -370,8 +580,8 @@ components: details. causes: code: MISSING_MANDATORY_PARAM - field: $.transaction.payments.brand - message: The value of a field was missed or not valid. + field: $.transaction.customer_account.account_type + message: The value of a field should not be null. allOf: - $ref: "#/components/schemas/Error" - type: object @@ -392,10 +602,10 @@ components: type: string description: A JSON Path expression indicating which field, in the request body, caused the error. - example: $.transaction.payments.brand + example: $.transaction.customer_account.account_type message: type: string - example: The value of a field was missed or not valid. + example: The value of a field should not be null. OrderPurchaseUpdateRequest: title: OrderPurchaseUpdateRequest description: > @@ -662,7 +872,7 @@ components: type: string format: date-time description: Date and time when the chargeback was reported to the partner, in - ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. InsultDetail: title: InsultDetail type: object @@ -672,7 +882,7 @@ components: type: string format: date-time description: Date and time when the insult was reported to the partner, in - ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. Status: title: Status description: > @@ -718,6 +928,8 @@ components: properties: transaction: $ref: "#/components/schemas/OrderPurchaseTransaction" + required: + - transaction OrderPurchaseTransaction: title: OrderPurchaseTransaction type: object @@ -773,7 +985,6 @@ components: DeviceDetails: title: DeviceDetails required: - - device_box - ip_address type: object properties: @@ -798,7 +1009,6 @@ components: - order_type - travel_products - travelers - - payments type: object properties: order_id: @@ -905,7 +1115,7 @@ components: - country_code registered_time: description: The local date and time that the customer first registered on the - client site, in ISO-8061 date and time format + client site, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time @@ -940,7 +1150,7 @@ components: description: Age of the traveler. type: number birth_date: - description: Date of birth for traveler, in ISO-8061 date and time format + description: Date of birth for traveler, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time @@ -1005,14 +1215,11 @@ components: * `HOTEL`: `Hotel` * `RAIL`: `Rail` - - * `ACTIVITIES`: `Activities` required: - price - type - inventory_type - inventory_source - - travelers_references type: object discriminator: propertyName: type @@ -1023,7 +1230,6 @@ components: INSURANCE: "#/components/schemas/Insurance" HOTEL: "#/components/schemas/Hotel" RAIL: "#/components/schemas/Rail" - ACTIVITIES: "#/components/schemas/Activities" properties: price: $ref: "#/components/schemas/Amount" @@ -1052,8 +1258,6 @@ components: * `Hotel` : `HOTEL` * `Rail` : `RAIL` - - * `Activities` : `ACTIVITIES` type: string maxLength: 30 inventory_source: @@ -1125,15 +1329,11 @@ components: * [GUID2] - * Activities - - * [GUID1] - * The example above demonstrates the association of travelers with various products. * All three travelers (A, B, and C) are associated with the Air product. - * Traveler A is associated with the Hotel and Activities products. + * Traveler A is associated with the Hotel. * Traveler C is associated with the Car product. @@ -1144,6 +1344,19 @@ components: items: type: string maxLength: 50 + pay_later: + description: > + The attribute serves as a boolean indicator that significantly + influences the handling of payment information during the fraud + prevention process: + + * When 'pay_later' is set to 'true': + - This configuration signals that payment information is optional for the booking. Travelers are given the choice to defer payment until they arrive at the rental counter following the completion of the booking. + - It is imperative for partners to explicitly set this attribute to 'true' when payment information can be optional for a particular booking scenario. + * When 'pay_later' is set to 'false': + - In this mode, the attribute mandates the inclusion of payment information during the order purchase screen request. Travelers are required to provide payment details. + - Partners must exercise caution and ensure they supply the necessary payment information, as failure to do so in cases where 'pay_later' is set to 'false' will result in a 'Bad Request' error. This error helps maintain the consistency and accuracy of the fraud prevention process and payment handling. + type: boolean Rail: title: Rail allOf: @@ -1187,14 +1400,14 @@ components: properties: departure_time: description: The local date and time of the scheduled departure from the - departure station, in ISO-8061 date and time format + departure station, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 arrival_time: description: The local date and time of the scheduled arrival at the destination - station, in ISO-8061 date and time format + station, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time @@ -1269,7 +1482,14 @@ components: maxLength: 200 example: GCT address: - $ref: "#/components/schemas/Address" + allOf: + - $ref: "#/components/schemas/Address" + - required: + - address_line1 + - city + - state + - zip_code + - country_code timezone: description: The timezone associated with the location of the station, specifying the local time offset from Coordinated Universal Time @@ -1277,161 +1497,6 @@ components: type: string maxLength: 200 example: America/New_York - Activities: - title: Activities - allOf: - - $ref: "#/components/schemas/TravelProduct" - - type: object - required: - - activity - - operating_company - - start_time - - end_time - - ticket - properties: - activity: - $ref: "#/components/schemas/Activity" - operating_company: - $ref: "#/components/schemas/OperatingCompany" - is_coupon_required: - description: "A coupon is typically a document or electronic code that confirms - your reservation or purchase for the activity. It serves as - proof of payment and allows you to participate in the activity. - This field indicates whether a coupon is necessary for this - activity. | For example, let's consider two scenarios: | - Activity: Adventure Park | is_coupon_required: false | In this - case, the attribute is set to 'false,' indicating that no coupon - is necessary. However, you might still need to purchase a ticket - to gain entry to the adventure park. The ticket serves as proof - of payment and grants you access to the park's activities and - attractions. | Activity: Spa Package | is_coupon_required: true - | Here, the attribute is set to 'true,' indicating that a coupon - is required. To participate in the spa package, you would need - to present the designated coupon at the spa. The coupon confirms - your reservation, serves as proof of payment, and may entitle - you to specific spa treatments or discounts." - type: boolean - location_coordinates: - $ref: "#/components/schemas/Coordinates" - start_time: - description: The field represents the start time of a activity, using the - ISO-8061 date and time format yyyy-MM-ddTHH:mm:ss.SSSZ. - type: string - format: date-time - maxLength: 50 - end_time: - description: The field represents the end time of a activity, using the ISO-8061 - date and time format yyyy-MM-ddTHH:mm:ss.SSSZ. - type: string - format: date-time - maxLength: 50 - ticket: - description: This field provides information about the tickets available for the - activity. - type: array - items: - $ref: "#/components/schemas/Ticket" - minItems: 1 - maxItems: 40 - Activity: - title: Activity - description: Provides essential details about a specific activity. - type: object - required: - - type - - description - properties: - type: - description: "This field provides a categorization of the different types of - activities available within the activity product. It is designed to - accommodate the preferences of the API consumer, allowing them to - assign a descriptive label or keyword that accurately represents the - nature of each activity. Here are some suggested values for this - field: | Adventures: This category includes activities such as - hiking, zip-lining, rock climbing, bungee jumping, and other - adventurous pursuits. | Air, Balloon & Helicopter Tours: This - category offers activities like hot air balloon rides, helicopter - tours, and aerial sightseeing experiences. | Cruises & Water Tours: - This includes options such as boat cruises, yacht tours, river - rafting, snorkeling, and diving expeditions. | Nightlife: This - category encompasses activities like clubbing, pub crawls, live - music events, and cultural performances. These activities - predominantly occur during the evening or nighttime." - type: string - maxLength: 200 - example: Balloon & Helicopter Tours - description: - description: This field within the trip information provides additional details - or a brief explanation about the specific trip or activity being - described - type: string - maxLength: 200 - example: 2-Day, 2 Day Ticket Weekend - Coordinates: - title: Coordinates - type: object - description: Group of attributes intended to hold information about location - coordinates. - properties: - latitude: - type: number - description: The latitude in degrees. It must be in the range [-90.0, +90.0]. - minimum: -90 - maximum: 90 - longitude: - type: number - description: The longitude in degrees. It must be in the range [-180.0, +180.0]. - minimum: -180 - maximum: 180 - OperatingCompany: - title: OperatingCompany - description: This field helps to identify and understand the specific provider - or operating company involved in offering the activity. - type: object - required: - - name - - type - properties: - name: - description: This field includes the provider's name. - type: string - example: VIATOR - type: - description: "This field indicates the nature or relationship of the vendor - associated with a particular activity. | THIRD_PARTY: This value - indicates that the vendor is an external entity or third-party - provider. | DIRECT: This value signifies that the vendor is a direct - entity or provider associated with the organization or platform - offering the activity." - type: string - enum: - - THIRD_PARTY - - DIRECT - Ticket: - title: Ticket - description: This field provides information about the tickets related to the - activity. - type: object - required: - - category - - quantity - properties: - category: - type: string - description: Describes the type or category of the ticket. - enum: - - ADULT - - CHILD - - SENIOR - - STUDENT - - OTHER - quantity: - description: This field represents the count or number of a specific ticket type - associated with an activity. - type: integer - format: int32 - minimum: 1 - maximum: 30 Air: title: Air allOf: @@ -1445,13 +1510,13 @@ components: properties: departure_time: description: Local date and time of departure from original departure location, - in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 arrival_time: description: Local date and time of arrival to final destination location, in - ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 @@ -1500,12 +1565,12 @@ components: maxLength: 10 departure_time: description: Local date and time of departure from departure location, in - ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 arrival_time: - description: Local date and time of arrival to destination location, in ISO-8061 + description: Local date and time of arrival to destination location, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time @@ -1525,13 +1590,13 @@ components: properties: departure_time: description: Local date and time of departure from original departure location, - in ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 arrival_time: description: Local date and time of arrival from original arrival location, in - ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 @@ -1568,13 +1633,13 @@ components: type: string maxLength: 200 pickup_time: - description: Local date and time the automobile will be picked-up, in ISO-8061 + description: Local date and time the automobile will be picked-up, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 return_time: - description: Local date and time the automobile will be returned, in ISO-8061 + description: Local date and time the automobile will be returned, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time @@ -1611,15 +1676,22 @@ components: type: integer format: int32 address: - $ref: "#/components/schemas/HotelAddress" + allOf: + - $ref: "#/components/schemas/HotelAddress" + - required: + - address_line1 + - city + - state + - zip_code + - country_code checkin_time: - description: Local date and time of the hotel check-in, in ISO-8061 date and + description: Local date and time of the hotel check-in, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 checkout_time: - description: Local date and time of the hotel check-out, in ISO-8061 date and + description: Local date and time of the hotel check-out, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time @@ -2054,7 +2126,6 @@ components: - INSURANCE - HOTEL - RAIL - - ACTIVITIES Insurance: title: Insurance allOf: @@ -2153,7 +2224,7 @@ components: type: string maxLength: 200 expiry_date: - description: Expiration date of the credit card used for payment, in ISO-8061 + description: Expiration date of the credit card used for payment, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time @@ -2407,7 +2478,7 @@ components: last_verified_date_time: description: Local date and time user validated possession of their phone number via a text or voice multi factor authentication challenge, in - ISO-8061 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. type: string format: date-time maxLength: 50 @@ -2463,18 +2534,755 @@ components: type: string pattern: ^[A-Z]{3}$ maxLength: 3 + AccountTakeoverError: + description: The object used to describe an error, containing both + human-readable and machine-readable information. + type: object + properties: + code: + description: Snake cased all caps error code interpreted from the HTTP status + code that can programmatically be acted upon. + type: string + example: BAD_REQUEST + enum: + - UNAUTHORIZED + - FORBIDDEN + - NOT_FOUND + - ACCOUNT_UPDATE_NOT_FOUND + - TOO_MANY_REQUESTS + - INTERNAL_SERVER_ERROR + - BAD_GATEWAY + - RETRYABLE_ACCOUNT_SCREEN_FAILURE + - RETRYABLE_ACCOUNT_UPDATE_FAILURE + - GATEWAY_TIMEOUT + - BAD_REQUEST + message: + description: A human-readable explanation of the error, specific to this error + occurrence. + type: string + example: An input validation error was encountered. Please see causes for more + details. + required: + - code + - message + AccountTakeoverUnauthorizedError: + description: Indicates that the token sent in the 'Authorization' header is + either invalid or missing. Please check the value in the token field + along with the token expiration time before retrying. + example: + code: UNAUTHORIZED + message: Invalid EG token provided. Please provide a valid token in the + Authorization header. + allOf: + - $ref: "#/components/schemas/AccountTakeoverError" + AccountUpdateNotFoundError: + description: Indicates that the API cannot find the resource that is either + being requested or against which the operation is being performed. + example: + code: ACCOUNT_UPDATE_NOT_FOUND + message: The request failed because the Account Screen event for this account is + missing. Please send a new Account Screen event again. + allOf: + - $ref: "#/components/schemas/AccountTakeoverError" + ServiceUnavailableError: + description: > + Indicates that the API is either down for maintenance or overloaded and + cannot fulfill the request at the current time. This is a temporary + error and retrying the same request after a certain delay could + eventually result in success. + + There will be a Retry-After HTTP header in API response specifying how long to wait to retry the request. If there is no Retry-After HTTP header then retry can happen immediately. If the error persists after retrying with delay, please reach out to ." + example: + code: RETRYABLE_ACCOUNT_SCREEN_FAILURE + message: A temporary internal error occurred. You can safely retry your call + using the same account details. + allOf: + - $ref: "#/components/schemas/AccountTakeoverError" + AccountTakeoverBadRequestError: + description: Indicates that a bad request occurred. Typically it is an invalid + parameter. + example: + code: BAD_REQUEST + message: An input validation error was encountered. Please see causes for more + details. + causes: + code: MISSING_MANDATORY_PARAM + field: $.transaction.device_details.device_box + message: The value of a field was missed or not valid. + allOf: + - $ref: "#/components/schemas/AccountTakeoverError" + - type: object + properties: + causes: + type: array + items: + type: object + properties: + code: + type: string + example: MISSING_MANDATORY_PARAM + enum: + - MISSING_MANDATORY_PARAM + - INVALID_PARAM + - INVALID_FORMAT + field: + type: string + description: A JSON Path expression indicating which field, in the request body, + caused the error. + example: $.transaction.device_details.device_box + message: + type: string + example: The value of a field was missed or not valid. + AccountUpdateRequest: + title: AccountUpdateRequest + type: object + description: > + The `type` field value is used as a discriminator, with the following + mapping: + + * `MULTI_FACTOR_AUTHENTICATION_UPDATE`: `MultiFactorAuthenticationUpdate` + + * `REMEDIATION_UPDATE`: `RemediationUpdate` + discriminator: + propertyName: type + mapping: + MULTI_FACTOR_AUTHENTICATION_UPDATE: MultiFactorAuthenticationUpdate + REMEDIATION_UPDATE: RemediationUpdate + required: + - type + - risk_id + properties: + type: + type: string + description: The categorized type of account update event from the Partner's + system. + enum: + - MULTI_FACTOR_AUTHENTICATION_UPDATE + - REMEDIATION_UPDATE + risk_id: + description: The `risk_id` provided by Expedia's Fraud Prevention Service in the + `AccountScreenResponse`. + type: string + maxLength: 200 + example: "123456789" + MultiFactorAuthenticationUpdate: + title: MultiFactorAuthenticationUpdate + description: Information specific to a user's response to a Multi-Factor + Authentication initiated by the Partner's system as a result of a fraud + recommendation. + allOf: + - $ref: "#/components/schemas/AccountUpdateRequest" + - type: object + required: + - multi_factor_authentication_attempts + properties: + multi_factor_authentication_attempts: + type: array + minItems: 1 + maxItems: 20 + items: + $ref: "#/components/schemas/MultiFactorAuthenticationAttempt" + MultiFactorAuthenticationAttempt: + title: MultiFactorAuthenticationAttempt + type: object + description: Information specific to the update event by a user. + required: + - delivery_method + - status + - reference_id + - provider_name + - attempt_count + properties: + delivery_method: + type: string + description: The delivery method of the Multi-Factor Authentication to a user. + enum: + - EMAIL + - SMS + - VOICE + - PUSH + status: + type: string + description: > + The status of a user''s response to the Multi-Factor Authentication + initiated by the Partner''s system to the user.' + + - `SUCCESS` - Applicable if the user successfully passed the challenge. + + - `ABANDON` - Applicable if the user did not complete the challenge. + + - `FAILED` - Applicable if the user failed the challenge. + enum: + - SUCCESS + - ABANDON + - FAILED + reference_id: + type: string + description: The identifier related to a Multi-Factor Authentication attempt by + the Partner's system to the Multi-Factor Authentication provider. + maxLength: 200 + provider_name: + type: string + description: The vendor providing the Multi-Factor Authentication verification. + maxLength: 200 + attempt_count: + type: number + description: The number of attempts a user tried for this Multi-Factor + Authentication. + update_start_date_time: + type: string + description: The local date and time the Multi-Factor Authentication was + initiated to a user from the Partner's system, in ISO-8601 date and + time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + format: date-time + maxLength: 50 + update_end_date_time: + type: string + description: The local date and time the Multi-Factor Authentication to a user + ended in the Partner's system, in ISO-8601 date and time format + `yyyy-MM-ddTHH:mm:ss.SSSZ`. + format: date-time + maxLength: 50 + telephone: + $ref: "#/components/schemas/Telephone" + email_address: + type: string + description: Email address used for the Multi-Factor Authentication by a user. + format: email + maxLength: 200 + RemediationUpdate: + title: RemediationUpdate + description: Information specific to remediation actions initiated by the + Partner's system to a user as a result of a fraud recommendation. + allOf: + - $ref: "#/components/schemas/AccountUpdateRequest" + - type: object + required: + - remediation_update_actions + properties: + remediation_update_actions: + type: array + minItems: 1 + maxItems: 20 + items: + $ref: "#/components/schemas/RemediationUpdateAction" + RemediationUpdateAction: + title: RemediationUpdateAction + type: object + description: Information specific to the remediation action initiated by the + Partner's system to a user. + required: + - action_name + - status + properties: + action_name: + type: string + description: > + The categorized remediation action initiated by the Partner''s + system to a user. Possible values are: + + - `PASSWORD_RESET` - Applicable if this event is the result of a password reset by the Partner''s system. + + - `DISABLE_ACCOUNT` - Applicable if this event is the result of disabling an account by the Partner''s system. + + - `TERMINATE_ALL_SESSIONS` - Applicable if this event is the result of terminating all active user sessions of an account by the Partner''s system. + enum: + - PASSWORD_RESET + - DISABLE_ACCOUNT + - TERMINATE_ALL_SESSIONS + status: + type: string + description: > + The status of the remediation action. + - `SUCCESS` - Applicable if the Partner''s system was successfully able to perform the remediation action. + - `FAILED` - Applicable if the Partner''s system failed to perform the remediation action. + enum: + - SUCCESS + - FAILED + update_end_date_time: + type: string + description: The local date and time the remediation action to a user ended in + the Partner's system, in ISO-8601 date and time format + `yyyy-MM-ddTHH:mm:ss.SSSZ`. + format: date-time + maxLength: 50 + AccountUpdateResponse: + title: AccountUpdateResponse + type: object + properties: + risk_id: + type: string + description: Unique identifier of transaction that was updated. + maxLength: 200 + example: "1234567" + AccountScreenRequest: + title: AccountScreenRequest + type: object + description: Information for account screening by Expedia's Fraud Prevention Service. + required: + - transaction + properties: + transaction: + $ref: "#/components/schemas/AccountTransaction" + AccountScreenResponse: + title: AccountScreenResponse + type: object + description: Response for an account transaction provided by Expedia's Fraud + Prevention Service. + properties: + risk_id: + type: string + description: Unique identifier assigned to the transaction by Expedia's Fraud + Prevention Service. + maxLength: 200 + example: "1234567" + decision: + $ref: "#/components/schemas/AccountTakeoverFraudDecision" + AccountTakeoverFraudDecision: + title: FraudDecision + type: string + description: > + Fraud recommendation for an account transaction. A recommendation can be + ACCEPT, CHALLENGE, or REJECT. + + - `ACCEPT` - Represents an account transaction where the user’’s account activity is accepted. + + - `CHALLENGE` - Represents an account transaction that requires additional verification or challenges the user’’s identity (example: CAPTCHA, MULTI_FACTOR_AUTHENTICATION, etc). + + - `REJECT` - Represents a suspicious account transaction where the user’’s credentials or their behavior requires us to block the account activity. + enum: + - ACCEPT + - CHALLENGE + - REJECT + AccountTransaction: + title: AccountTransaction + type: object + description: Information for an account transaction. + required: + - site_info + - device_details + - customer_account + - transaction_details + properties: + site_info: + $ref: "#/components/schemas/AccountTakeoverSiteInfo" + device_details: + $ref: "#/components/schemas/AccountTakeoverDeviceDetails" + customer_account: + $ref: "#/components/schemas/AccountTakeoverCustomerAccount" + transaction_details: + $ref: "#/components/schemas/AccountTakeoverTransactionDetails" + AccountTakeoverSiteInfo: + title: SiteInfo + type: object + description: Information specific to the Partner's website through which a + transaction was made. + required: + - brand_name + properties: + locale: + type: string + description: The locale of the website a user is accessing, which is separate + from the user configured browser locale, in ISO 639-2 language code + format and in ISO 3166-1 country code format. + pattern: ^([a-z]{2}-[A-Z]{2})$ + example: en-US + name: + type: string + description: Name of the website from which the event is generated. + example: expedia.com + maxLength: 200 + brand_name: + type: string + description: The trademark brand name that is displayed to a user on the website. + maxLength: 200 + placement_name: + type: string + description: > + The categorized name of the page where a user initiated event is + being evaluated. + + - `LOGIN` - Applicable if the user initiated this account event from a login web page. + + - `PASSWORD_RESET` - Applicable if the user initiated this account event from a password reset web page. + enum: + - LOGIN + - PASSWORD_RESET + AccountTakeoverDeviceDetails: + title: DeviceDetails + type: object + description: Information specific to the Partner's device through which a + transaction was made. + required: + - device_box + - ip_address + - user_agent + properties: + source: + type: string + maxLength: 50 + description: Source of the device_box. Default value is `TrustWidget`. + device_box: + type: string + maxLength: 16000 + description: Device related information retrieved from TrustWidget. + ip_address: + type: string + description: IP address of the device used for this event. + pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$ + example: 192.168.32.48 + user_agent: + type: string + description: The application type, operating system, software vendor, or + software version of the originating request. + maxLength: 200 + example: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, + like Gecko) Chrome/114.0.0.0 Safari/537.36 + type: + type: string + description: > + The categorized type of device used by a user. Possible values are: + + - `WEBSITE` - Applicable if the user initiated this event from a web browser on a desktop computer. + + - `PHONE_WEB` - Applicable if the user initiated this event from a web browser on a phone. + + - `TABLET_WEB` - Applicable if the user initiated this event from a web browser on a tablet. + + - `PHONE_APP` - Applicable if the user initiated this event from an app on a phone. + + - `TABLET_APP` - Applicable if the user initiated this event from an app on a tablet. + enum: + - WEBSITE + - PHONE_WEB + - TABLET_WEB + - PHONE_APP + - TABLET_APP + AccountTakeoverCustomerAccount: + title: CustomerAccount + type: object + description: Information about a user's account. + required: + - user_id + - account_type + - username + - email_address + - registered_time + - active_flag + properties: + user_id: + type: string + description: Unique account identifier provided by the Partner's Identity + Provider/System assigned to the account owner by the partner. + `user_id` is specific to the Partner's namespace. Used to track + repeat account activity by the same user. + maxLength: 200 + account_type: + type: string + description: > + Identifies the account type of a user''s account. Possible values + are: + + - `INDIVIDUAL` - Applicable if this account is for an individual traveler. + + - `BUSINESS` - Applicable if this account is for a business or organization account used by suppliers or Partners. + enum: + - INDIVIDUAL + - BUSINESS + account_role: + type: string + description: > + Identifies the account role and associated permissions of a user''s + account. Possible values are: + + - `USER`: Basic account with no special privileges. + + - `MANAGER`: Account with additional privileges, such as the ability to make bookings for others. + + - `ADMIN`: Account with higher privileges than a manager, including the ability to grant manager access to other users. + enum: + - USER + - MANAGER + - ADMIN + name: + $ref: "#/components/schemas/AccountTakeoverName" + username: + type: string + description: Username of the account. + maxLength: 200 + email_address: + description: Email address for the account owner. + type: string + format: email + telephones: + type: array + maxItems: 20 + items: + $ref: "#/components/schemas/Telephone" + address: + allOf: + - $ref: "#/components/schemas/Address" + - required: + - address_line1 + - city + - state + - zip_code + - country_code + registered_time: + description: The local date and time that the customer first registered on the + Partner's site, in ISO-8601 date and time format + `yyyy-MM-ddTHH:mm:ss.SSSZ`. + type: string + format: date-time + maxLength: 50 + active_flag: + type: boolean + description: Indicator for if this account is an active account or not. + loyalty_member_id: + type: string + description: Unique loyalty identifier for a user. + maxLength: 200 + AccountTakeoverName: + title: Name + description: Group of attributes intended to hold information about a customer + or traveler''s name for the account. + type: object + required: + - first_name + - last_name + properties: + last_name: + description: Surname, or last name, of the person. + type: string + maxLength: 200 + first_name: + description: Given, or first name, of the person. + type: string + maxLength: 200 + middle_name: + description: Middle name of the person. + type: string + maxLength: 200 + title: + description: Title of the person for name (e.g. Mr., Ms. etc). + type: string + maxLength: 200 + suffix: + description: Generational designations (e.g. Sr, Jr, III) or values indicate + that the individual holds a position, educational degree, + accreditation, office, or honor (e.g. PhD, CCNA, OBE). + type: string + maxLength: 50 + AccountTakeoverTransactionDetails: + title: TransactionDetails + type: object + description: > + The `transaction_type` field value is used as a discriminator, with the + following mapping: + + * `LOGIN`: `LoginTransactionDetails` + required: + - type + - transaction_date_time + - transaction_id + discriminator: + propertyName: type + mapping: + LOGIN: "#/components/schemas/LoginTransactionDetails" + properties: + type: + type: string + description: The categorized type of account event related to a user's action. + enum: + - LOGIN + transaction_date_time: + type: string + description: The local date and time the transaction occured in the Partner's + system, in ISO-8601 date and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + format: date-time + maxLength: 50 + transaction_id: + type: string + description: Unique identifier to identify a transaction attempt in the + Partner's system. + maxLength: 200 + current_user_session: + $ref: "#/components/schemas/CurrentUserSession" + LoginTransactionDetails: + title: LoginTransactionDetails + allOf: + - $ref: "#/components/schemas/AccountTakeoverTransactionDetails" + - type: object + description: Specific information about a login transaction for a user. + required: + - authentication_type + - successful_login_flag + properties: + authentication_type: + type: string + description: > + The type of login authentication method used by a user. + + For `authentication_type` ensure attributes mentioned in dictionary below are set to corresponding values only. + + `authentication_type` is an enum value with the following mapping with `authentication_sub_type` attribute: + + * authentication_type : authentication_sub_type + + * ------------------------------------------------------------------------------- + + * `CREDENTIALS` : `EMAIL` + + * `CREDENTIALS` : + + * `PASSWORD_RESET` : `EMAIL` + + * `SINGLE_SIGN_ON` : `EMAIL` + + * `MULTI_FACTOR_AUTHENTICATION` : `EMAIL` + + * `MULTI_FACTOR_AUTHENTICATION` : `PHONE` + + * `SOCIAL` : `GOOGLE` + + * `SOCIAL` : `FACEBOOK` + + * `SOCIAL` : `APPLE` + enum: + - CREDENTIALS + - PASSWORD_RESET + - SOCIAL + - SINGLE_SIGN_ON + - MULTI_FACTOR_AUTHENTICATION + authentication_sub_type: + type: string + description: > + The sub type of login authentication method used by a user. + + For `authentication_sub_type` ensure attributes mentioned in dictionary below are set to corresponding values only. + + `authentication_sub_type` is an enum value with the following mapping with `authentication_type` attribute: + + * authentication_sub_type : authentication_type + + * ------------------------------------------------------------------------------- + + * `EMAIL` : `CREDENTIALS` + + * `EMAIL` : `PASSWORD_RESET` + + * `EMAIL` : `SINGLE_SIGN_ON` + + * `EMAIL` : `MULTI_FACTOR_AUTHENTICATION` + + * `PHONE` : `MULTI_FACTOR_AUTHENTICATION` + + * `GOOGLE` : `SOCIAL` + + * `FACEBOOK` : `SOCIAL` + + * `APPLE` : `SOCIAL` + + * : `CREDENTIALS` + enum: + - EMAIL + - PHONE + - GOOGLE + - FACEBOOK + - APPLE + successful_login_flag: + type: boolean + description: Identifies if a login attempt by a user was successful or not. + failed_login_reason: + type: string + description: > + The reason for the failed login attempt in the Partner''s + system, related to user failure or Partner''s system failure. + + - `INVALID_CREDENTIALS` - Applicable if the user provided invalid login credentials for this login attempt. + + - `ACCOUNT_NOT_FOUND` - Applicable if the user attempted to login to an account that doesn't exist. + + - `VERIFICATION_FAILED` - Applicable if the user failed the verification for this login, or any authentication exception occured in the Partner system for this login attempt. + + - `ACCOUNT_LOCKED` - Applicable if the user attempted to login to an account that is locked. + enum: + - INVALID_CREDENTIALS + - ACCOUNT_NOT_FOUND + - VERIFICATION_FAILED + - ACCOUNT_LOCKED + CurrentUserSession: + title: CurrentUserSession + type: object + description: > + The current user session prior to this transaction, which contains + details related to any challenge initiated by the Partner''s system to a + user before calling Expedia''s Fraud Prevention Service. + + An example is if the Partner''s system sent a Captcha challenge to the user before calling Expedia''s Fraud Prevention Service. + properties: + session_id: + type: string + description: Unique identifier for a user's session on their device + maxLength: 200 + start_date_time: + type: string + description: The local date and time a user's session started, in ISO-8601 date + and time format `yyyy-MM-ddTHH:mm:ss.SSSZ`. + format: date-time + maxLength: 50 + challenge_detail: + $ref: "#/components/schemas/ChallengeDetail" + ChallengeDetail: + title: ChallengeDetail + type: object + description: Information related to challenges initiated by the Partner's system + to a user before calling Expedia's Fraud Prevention Service. + required: + - displayed_flag + - type + - status + properties: + displayed_flag: + type: boolean + description: Indicates that there was a challenge initiated by the Partner's + system to a user before calling Expedia's Fraud Prevention Service. + type: + type: string + description: > + The kind of challenge served by the Partner''s system to a user + prior to calling Expedia''s Fraud Prevention Service. + + - `CAPTCHA` - Applicable if the challenge served by the Partner''s system was a Captcha challenge. + + - `TWO_FACTOR` - Applicable if the challenge served by the Partner''s system was a two-factor challenge including (Email verification, One Time Password, Okta, etc). + enum: + - CAPTCHA + - TWO_FACTOR + status: + type: string + description: > + The status of the challenge served by the Partner''s system to a + user before calling Expedia''s Fraud Prevention Service. + + - `SUCCESS` - Applicable if the user successfully passed the challenge. + + - `FAILED` - Applicable if the user failed the challenge. + enum: + - SUCCESS + - FAILED securitySchemes: orderPurchaseScreenAuth: type: oauth2 flows: clientCredentials: - tokenUrl: /identity/oauth2/v3/token?grant_type=client_credentials + tokenUrl: https://api.expediagroup.com/identity/oauth2/v3/token?grant_type=client_credentials scopes: fraudandrisk.stub.order-purchase-screen: Use Fraud Systems for screening orders orderPurchaseUpdateAuth: type: oauth2 flows: clientCredentials: - tokenUrl: /identity/oauth2/v3/token?grant_type=client_credentials + tokenUrl: https://api.expediagroup.com/identity/oauth2/v3/token?grant_type=client_credentials scopes: fraudandrisk.stub.order-purchase-update: Use Fraud Systems for updating orders