Radial Integration | 2016

Payments, Tax & Fraud > Payments Processing > PayPal Processing > PayPal GetExpress

PayPal GetExpress

API Description

GetExpress request uses the Token received in the SetExpress response message to retrieve information about the customer (referred to as Payer). The most important and useful element of the information returned in the GetExpress response is PayerId. PayerId is used to uniquely identify the customer and is used in the next call in the PayPal Checkout flow, the DoExpress request.

For Express Checkout Easy Payments, it will return additional financing information in the GetExpress reply.

URI Summary

Action URI Template URI Example Non-URI Request Response
POST /vM.m/stores/[StoreId]/payments/paypal/getExpress.xml /v1.0/stores/AStoreId/
payments/paypal/getExpress.xml
XML 200 + XML Response containing PayPal PayerId.

Request Elements

Element Required Description Type Restriction
StoreId Yes Store Identifier used in the URL. String 20 Characters
OrderId Yes Order Identifier. String 20 Characters
Token Yes The timestamped token value that was returned by PayPalSetExpressCheckoutReply and passed on PayPalGetExpressCheckoutRequest. String Generated by PayPal
CurrencyCode Yes Currency used. NMTOKEN IS-4217 three-letter code
SchemaVersion Yes

Although marked as optional in the the schema, this element needs to be passed at all times with a value of 1.1 or greater in order to receive elements like 'ErrorMessage', ‘ShortErrorMessage’, ‘ErrorCode’ in the Response message.

String

pattern = "([0-9]+\.)*[0-9]+".
Value Example: 1.1, 1.2

Request Example

The request is a PayPalGetExpressCheckoutRequest message.

<?xml version="1.0" encoding="UTF-8"?>
<PayPalGetExpressCheckoutRequest xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
  <OrderId>12345</OrderId>
  <Token>EC-5YE59312K56892714</Token>
  <CurrencyCode>"USD"</CurrencyCode>
  <SchemaVersion>1.1</SchemaVersion>
</PayPalGetExpressCheckoutRequest>

Response Elements

Element Required Description Type Restriction
OrderId Yes Order Identifier. String 20 Characters
ResponseCode Yes Response Code returned from Payment Service String Success, Failure
PayerEmail No Email address of the payer. String 127 single-byte characters.
PayerId No Unique identifier of the customer's PayPal account. Not Present in case of failure. String 127 single-byte characters.
PayerStatus No Status of payer's email address. String Status coming from PayPal.
PayerName No Name of payer. Complex Type Includes: Honorific, LastName, MiddleName, FirstName.
Honorific No Salutation for the Payer String 10 Characters.
LastName Yes Last Name of the Payer String 64 Characters.
MiddleName No Middle Name of the Payer String 40 Characters.
FirstName Yes First Name of the Payer String 64 Characters.
PayerCountry No Payment sender's country of residence. String Standard two-character ISO 3166 country codes. See http://countrycode.org
BillingAddress No Payer's business address on file with PayPal. Complex Type Includes: Line1, Line2, Line3, Line4, City, MainDivision, CountryCode, PostalCode
Line1 Yes Line 1 of the address String Between 1 and 70 Characters.
Line2 No Line 2 of the address String Between 1 and 70 Characters.
Line3 No Line 3 of the address String Between 1 and 70 Characters.
Line4 No Line 4 of the address String Between 1 and 70 Characters.
City Yes City the order will be shipped to. String Between 1 and 40 Characters.
MainDivision No This is the State/Province name String Between 1 and 35 Characters. Use of the ISO 3166-2 code is recommended but not required.
CountryCode Yes Country the order will be shipped to. String Between 2 and 40 Characters. Use of the ISO 3166 alpha 2 code is recommended but not required.
PostalCode No Postal Code the order will be shipped to. String Between 1 and 15 Characters.
PayerPhone No Payer's business address on file with PayPal String No Restrictions.
ShippingAddress No Shipping address selected by Payer on PayPal pages. Complex Type Inner elements same as the BillingAddress elements.
ErrorMessage No Full Error Description. String Present only when the ResponseCode is Failure and SchemaVersion in the Request is equal to or greater than 1.1.
ShortErrorMessage No Short Error Description. String Present only when the ResponseCode is Failure and SchemaVersion in the Request is equal to or greater than 1.1.
ErrorCode No Error code coming from PayPal. String Present only when the ResponseCode is Failure and SchemaVersion in the Request is equal to or greater than 1.1.
PaymentInfo No Additional financing information for Express Checkout Easy Payments Complex Type Includes: FinancingApproved, FinancingFeeAmount, FinancingTerm, FinancingMonthlyPayment, FinancingTotalCost
FinancingApproved No Indicates whether the customer was approved for and chose to make payment using Easy Payments Boolean true/false
FinancingFeeAmount No Fee amount the customer has to pay during the lifetime of the loan Decimal 2 precision points. (123.34)
currencyCode Yes if Financing Fee Amount is present Code identifies the currency for the Amount. String IS-4217 three-letter code
FinancingTerm No Indicates the payment term. Example values are 6, 12, 18, and 24 months. Int No Restrictions.
FinancingMonthlyPayment No Estimated amount per month that the customer will need to pay including fees and interests. Decimal 2 precision points. (123.34)
currencyCode Yes if Financing Monthly Payment is present Code identifies the currency for the Amount. String IS-4217 three-letter code
FinancingTotalCost No Estimated total payment amount including fees and interests the user will pay during the lifetime of the loan. Decimal 2 precision points. (123.34)
currencyCode Yes if Financing Total Cost is present Code identifies the currency for the Amount. String IS-4217 three-letter code
CartChangeTolerance No Indicate the tolerance a cart can be changed.
Possible values are

NONE = cart cannot be changed (since financing was used and country is DE).

FLEXIBLE = cart can be changed

If this parameter does not exist, then assume cart can be modified.
String NONE, FLEXIBLE

Successful Response Example

The response is a PayPalGetExpressCheckoutReply message.

<?xml version="1.0" encoding="UTF-8"?>
<PayPalGetExpressCheckoutReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
  <OrderId>12345</OrderId>
  <ResponseCode>Success</ResponseCode>
  <PayerEmail>payer@gmail.com</PayerEmail>
  <PayerId>CNQNHXX9RCE9S</PayerId>
  <PayerStatus>Verified</PayerStatus>
  <PayerName>
    <Honorific>Mr.</Honorific>
    <LastName>Smith</LastName>
    <MiddleName>Michael</MiddleName>
    <FirstName>John</FirstName>
  </PayerName>
  <PayerCountry>US</PayerCountry>
  <BillingAddress>
    <Line1>630 Allendale Road</Line1>
    <Line2>Building A</Line2>
    <Line3>2nd Floor</Line3>
    <Line4>Appartment 17</Line4>
    <City>Philadelphia</City>
    <MainDivision>PA</MainDivision>
    <CountryCode>USA</CountryCode>
    <PostalCode>19001</PostalCode>
  </BillingAddress>
  <PayerPhone>2152221111</PayerPhone>
  <ShippingAddress>
    <Line1>630 Allendale Road</Line1>
    <Line2>Building A</Line2>
    <Line3>2nd Floor</Line3>
    <Line4>Appartment 17</Line4>
    <City>Philadelphia</City>
    <MainDivision>PA</MainDivision>
    <CountryCode>USA</CountryCode>
    <PostalCode>19001</PostalCode>
  </ShippingAddress>
</PayPalGetExpressCheckoutReply>

Successful Response Example with Different Billing and Shipping Address

The response is a PayPalGetExpressCheckoutReply message.

<?xml version="1.0" encoding="UTF-8"?>
<PayPalGetExpressCheckoutReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
  <OrderId>559749</OrderId>
  <ResponseCode>Success</ResponseCode>
  <PayerEmail>chopuk_1326139738_per@gsicommerce.com</PayerEmail>
  <PayerId>CNQNHXX9RCE9S</PayerId>
  <PayerStatus>verified</PayerStatus>
  <PayerName>
    <LastName>User</LastName>
    <FirstName>Test</FirstName>
  </PayerName>
  <PayerCountry>GB</PayerCountry>
  <BillingAddress>
    <Line1>49 Featherstone Street</Line1>
    <Line2/>
    <City>LONDON</City>
    <MainDivision>London</MainDivision>
    <CountryCode>GB</CountryCode>
    <PostalCode>EC1Y 8SY</PostalCode>
  </BillingAddress>
  <PayerPhone>+44 3565606206</PayerPhone>
  <ShippingAddress>
    <Line1>49 Queen Blvd</Line1>
    <Line2/>
    <City>Manchester</City>
    <MainDivision>Manchester</MainDivision>
    <CountryCode>GB</CountryCode>
    <PostalCode>MU1Y 8SY</PostalCode>
  </ShippingAddress>
</PayPalGetExpressCheckoutReply>

Successful Response Example with Express Checkout Easy Payments

The response is a PayPalGetExpressCheckoutReply message.

<?xml version="1.0" encoding="UTF-8"?>
<PayPalGetExpressCheckoutReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
  <OrderId>12345</OrderId>
  <ResponseCode>Success</ResponseCode>
  <PayerEmail>payer@gmail.com</PayerEmail>
  <PayerId>CNQNHXX9RCE9S</PayerId>
  <PayerStatus>Verified</PayerStatus>
  <PayerName>
    <Honorific>Mr.</Honorific>
    <LastName>Smith</LastName>
    <MiddleName>Michael</MiddleName>
    <FirstName>John</FirstName>
  </PayerName>
  <PayerCountry>US</PayerCountry>
  <BillingAddress>
    <Line1>630 Allendale Road</Line1>
    <Line2>Building A</Line2>
    <Line3>2nd Floor</Line3>
    <Line4>Appartment 17</Line4>
    <City>Philadelphia</City>
    <MainDivision>PA</MainDivision>
    <CountryCode>USA</CountryCode>
    <PostalCode>19001</PostalCode>
  </BillingAddress>
  <PayerPhone>2152221111</PayerPhone>
  <ShippingAddress>
    <Line1>630 Allendale Road</Line1>
    <Line2>Building A</Line2>
    <Line3>2nd Floor</Line3>
    <Line4>Appartment 17</Line4>
    <City>Philadelphia</City>
    <MainDivision>PA</MainDivision>
    <CountryCode>USA</CountryCode>
    <PostalCode>19001</PostalCode>
  </ShippingAddress>
  <PaymentInfo>
    <FinancingApproved>true</FinancingApproved>
    <FinancingFeeAmount currencyCode="USD">26.79</FinancingFeeAmount>
    <FinancingTerm>24</FinancingTerm>
    <FinancingMonthlyPayment currencyCode="USD">426.89</FinancingMonthlyPayment>
    <FinancingTotalCost currencyCode="USD">485.35.79</FinancingTotalCost>
  </PaymentInfo>
  <CartChangeTolerance>NONE</CartChangeTolerance>
</PayPalGetExpressCheckoutReply>

Failure Response Example

The response is a PayPalGetExpressCheckoutReply message.

<?xml version="1.0" encoding="UTF-8"?>
<PayPalGetExpressCheckoutReply xmlns="http://api.gsicommerce.com/schema/checkout/1.0">
  <OrderId>12345</OrderId>
  <ResponseCode>Failure</ResponseCode>
  <PayerEmail></PayerEmail>
  <PayerId></PayerId>
  <PayerStatus>Unverified</PayerStatus>
  <PayerName>
    <Honorific></Honorific>
    <LastName></LastName>
    <MiddleName></MiddleName>
    <FirstName></FirstName>
  </PayerName>
  <ErrorMessage>Invalid Token.</ErrorMessage>
  <ShortErrorMessage>Invalid Token.</ShortErrorMessage>
  <ErrorCode>1234</ErrorCode>
</PayPalGetExpressCheckoutReply>

Timeout Response Example

The response is a XmlFaultReply message.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XmlFaultReply xmlns="http://schema.gsicommerce.com/payments/services/1.0/"
      xmlns:payment="http://schema.gsicommerce.com/payments/types/1.0/">
  <payment:CreateTimestamp>2012-01-26T17:09:07.046Z</payment:CreateTimestamp>
  <payment:Code>SocketTimeoutException</payment:Code>
  <payment:Description>Read timed out</payment:Description>
</XmlFaultReply>

Next Step

After a successful GetExpress call, the next step is a DoExpress call.

 

Copyright © 2017 Radial. All rights reserved.