Account Information API

Verify travelers using your site using their account details

The Account Information API includes details about each traveler. An Expedia agent will use it to verify the traveler’s unique identifier for purchases, loyalty redemption, cancellations, and more. This unique identifier can be a credit card number (a Payment Card Industry (PCI) identifier) or a non-PCI identifier such as email address or loyalty account number, depending on your requirements or security standards.

See Common data and responses for additional information.

Get account information

You’ll use this set of fields to fetch account info for a loyalty member or card holder using POST /user/v1/account.

FieldDescriptionSample valueField typeMandatory?
partnerIdUnique identifier for your business, provided by ExpediaYOUR BRANDString, max 20 charactersYes
AuthorizationAccess token received by Expedia from your authorization server, to be validated by your teamStandard JSON web token (JWT)String, standard JWT length
Authorization2JSON web token (JWT) sent by Expedia; signature and claims to be validated on your endStandard JWTString, standard JWT length

Request

You will need to set either membershipId, loyaltyAccountNumber, cardNumber, or email as a mandatory parameter. Your account manager will work with you to define which will work best based on your requirements.

Note: If you are using cardNumber as your identifier, you will also need to review the cardDetails and billingAddress tables below. No other parameters require this data.

FieldDescriptionField typeMandatory?
requestIdUnique identifier for the transaction requestStringYes
membershipIdUnique traveler identifierStringYes, option 1
loyaltyAccountNumberThe traveler’s loyalty account number (also called programAccountNumber); this should only be populated if an identifier other than membershipId is required for loyalty operationsStringYes, option 2
programIdIdentifier for the loyalty program the traveler is affiliated to or the tier name associated with the loyalty programString
cardNumberTraveler credit card number (encrypted)StringYes, option 3
emailTraveler email addressStringYes, option 4

Response

FieldDescriptionField typeMandatory?
statusTransaction status (values: Approved, Declined)StringYes
requestIdUnique identifier for the transaction request (from request payload)StringYes
programAccountLoyalty program account details; see programAccount table for nested fields 
languageIdThe languages in which the site will be viewable; see the Locale details page for detailsString
optInForMarketingEmailWhether the user has opted for marketing emailsBoolean
channelTypePlatforms the site is optimized for (values: WEB, MOBILE, TABLET)String
userslist of user details; see users table for nested fields 
cardDetailsDetails about the credit card used in the transaction; see cardDetails table for nested fields (if populated, some nested items must be encrypted) 

programAccount

FieldDescriptionSample valueMandatory?
programIdIdentifier for the loyalty program the traveler is affiliated to or the tier name associated with the loyalty programAventura GoldYes
accountNameProgram name (if different from programId)Aventura
loyaltyAccountNumberThe traveler’s loyalty account number (also called programAccountNumber); this should only be populated if an identifier other than membershipId is required for loyalty operations1234567
lastFourDigitsOfCreditCardThe last 4 digits of the credit card the traveler used for the booking0000
loyaltyConversionRatioRatio of how payment converts to points earned (for example, $1 = 1 point) 
loyaltyAccountBalanceCurrent balance of traveler’s earned loyalty points2003Yes

cardDetails

FieldDescriptionField typeMandatory?
cardNumberTraveler credit card number (encrypted)StringYes
cardTypeType of card used (encrypted)StringYes
expirationDateExpiration date of card in MM/YYYY format (encrypted)StringYes
billingAddressBilling address of the card used in the transaction; see billingAddress table for nested fields 

billingAddress

FieldDescriptionField typeMandatory?
firstAddressLineFirst line of billing address (encrypted)StringYes
secondAddressLineSecond line of billing addressString
thirdAddressLinethird line of billing addressString
cityCity element of billing addressString
provinceProvince or state element of billing addressString
countryCodeCountry element of billing addressString
postalCodePostal code element of billing address (encrypted)StringYes

users

FieldDescriptionSample valueMandatory?
userIdUnique identifier for traveler; same as membershipId Yes
nameTraveler first, middle, and last name
firstNameTraveler’s first name; nested under nameBobYes
middleNameTraveler’s middle name; nested under nameRobert
lastNameTraveler’s last name; nested under nameJonesYes
contactInfoTraveler contact information, including address, email and phone number
addressTraveler address, including street address, city, state or province, and postal code; nested under contactInfo
streetAddressTraveler street address; nested under address123 Main St.
cityCity of traveler’s street address; nested under addressBoston
stateState of traveler’s street address; nested under addressMA
countryCountry of traveler’s street address; nested under addressUSA
postalCodePostal code of traveler’s street address; nested under address02112
taxProvinceThe state or province in which the traveler will be paying taxes; nested under addressMA
emailTraveler’s email address; nested under contactInfobrjones@somewhere.com
contactNumberTraveler’s phone number; nested under contactInfo555-555-5555
userTypeWhether the traveler is a single (primary) user or associated with an organization 
dateOfBirthTraveler’s date of birth 

Credit card encryption and decryption

If you use cardNumber as the traveler identifier for validation, some information will need to be encrypted. Expedia requires secure handling of PCI information using an industry-standard JWE (JSON web encryption) technique for encrypting and decrypting credit card details: asymmetric encryption using a public and private key pair.

Encryption use cases

The places where encryption should take place include:

  • Request: cardNumber
  • Response: cardDetails

In the request parameter, you should set up a 2048-bit CA (certificate authority)-signed RSA (Rivest Shamir Adleman) private key certificate and share it with Expedia. We’ll then use your public key to encrypt the cardNumber field using JWE and RSA.

In the response parameter, we’ll set up a 2048-bit CA-signed RSA private key and will share the corresponding public key certificate and share it with you. Using the Expedia public key, you’ll then encrypt each element of cardDetails using JWE and RSA.

We’ve laid out the steps to the encryption process below.

Encryption, step-by-step

Step 1: Fetch the public certificate and get the RSA 2048 public key.

  1. Generate a random symmetric key (RSK) of 256 bits length.
  2. Encrypt the RSK using the RSA 2048 public key using the algorithm RSA-OAEP-256.

Step 2: Generate a random initialization vector (IV) of 96 bits length.

Step 3: Encrypt plaintext data by using the RSK, IV, and the algorithm A256GCM to form the ciphertext and authentication tag data.

Step 4: Base64URL-encode the ciphertext to produce Base64URL (JWE ciphertext).

Step 5: Base64URL-encode the authentication tag, IV, RSK, and the JWE header JSON to produce:

  • Authentication tag data: Base64URL (JWE authentication tag).
  • IV: Base64URL (JWE initialization vector)
  • RSK: Base64URL (JWE encrypted key)
  • JWE header JSON: Base64URL (UTF8 (JWE header))

Then serialize the JWE object to its compact format consisting of Base64URL-encoded parts delimited by periods ('.') to produce:

Base64URL (UTF8) (JWE header) || '.' || Base64URL (JWE encrypted key) || '.' || Base64URL (JWE initialization vector) || '.' || Base64URL (JWE ciphertext) || '.' || Base64URL (JWE authentication tag)

Code samples

Sample Java for encryption

JWE encryption can be implemented efficiently and quickly the with help of third party JWE libraries. For example, this java code for encryption was created with the help of Nimbus JOSE+JWT library.

public String encryptWithJWE(String plainText){
    X509Certificate publicCertificate = <fetch public cert>
    //get RSA public key
    final X509EncodedKeySpec publicKeySpec = new 
    X509EncodedKeySpec(publicCertificate.getPublicKey().getEncoded());
    final KeyFactory keyFactory = KeyFactory.getInstance("RSA");
    RSAPublicKey rsaPublicKey = (RSAPublicKey) keyFactory.generatePublic(publicKeySpec);
    //get keyID
    String keyID = certificateManager.getKid(publicCertificate);
    // Create JWE Header containing the needed metadata for encryption and decryption
    JWEHeader jweHeader = new JWEHeader.Builder(JWEAlgorithm.RSA_OAEP_256, EncryptionMethod.A256GCM)
        .type(JOSEObjectType.JWT)
        .customParam(IAT, System.currentTimeMillis())
        .keyID(keyID)
        .build();
/*

Sample JWE header

{
"alg":"RSA-OAEP-256",
"typ":"JWT",
"enc":"A256GCM",
"iat":<Time (in UTC) when JWE was issued, expressed in UNIX epoch time (seconds since 1 January, 1970)>,
"kid":<Key ID or subject key Identifier from the public key certificate>
}
*/
    JWEObject jweObject = new JWEObject(jweHeader, new Payload(plainText));
    RSAEncrypter encrypter = new RSAEncrypter(rsaPublicKey);
    jweObject.encrypt(encrypter);
    return jweObject.serialize();
    }

Decryption of card number in request

Expedia will encrypt cardNumber in the request. The decryption path is the reverse of the encryption path:

  1. When you receive the encrypted JWE, you should decode the first section of the JWE, the JOSE header to determine the algorithm, the encryption, and the keyId (alg, enc, kid).
  2. You’ll then validate the iat (issued-at: the time the JWT was issued) to make sure it’s no more than 5 minutes different from the current time. (The token will expire after 5 minutes.)
  3. Next, fetch your private key and decrypt the JWE encryption key.
  4. Then, using the decrypted RSK, the JWE initialization vector, and the JWE authentication tag, you can decrypt the JWE ciphertext parameter and verify it.

Code sample

Sample Java for encryption

JWE encryption can be implemented efficiently and quickly the with help of third party JWE libraries. For example, this java code for encryption was created with the help of Nimbus JOSE+JWT library.

public String decryptJWE(String jweString) {
    PrivateKey privateKey = <fetch private key>;
    RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;
    JWEObject jweObject = JWEObject.parse(jweString);
    JWEHeader jweHeader = jweObject.getHeader();validateJweHeader(jweHeader);
    RSADecrypter rsaDecrypter = new RSADecrypter(rsaPrivateKey);
    jweObject.decrypt(rsaDecrypter);
    return jweObject.getPayload().toString();
}

API details

Without credit card information

With credit card information

Did you find this page helpful?
How can we improve this content?
Thank you for helping us improve!