OrderCreateRequest Payment Examples

The Payments element in OrderCreateRequest can contain different element types depending on the payment methods. Each of these types have different information that is expected. This page will cover some examples of the different payment types.

CreditCard Visa

The How to Build an Order Create API Request page uses a visa credit card in its example.

CreditCard American Express

An American Express credit card requires some extra data that other credit cards do not require. A PhoneResponseCode, NameResponseCode, and EmailResponseCode come back from CreditCardAuthReply; these elements must be copied as-is to the OrderCreateRequest for fraud processing. See mapping.

Copy
<OrderCreateRequest xmlns="http://api.gsicommerce.com/schema/checkout/1.0"
        requestId="123456789">
    <Order customerOrderId="12345">
        ...
        <Payment>
            ...
            <Payments>
                <CreditCard>
                    <PaymentContext>
                        <PaymentSessionId>12345</PaymentSessionId>
                        <TenderType>AM</TenderType>
                        <PaymentAccountUniqueId isToken="true">123abc</PaymentAccountUniqueId>
                    </PaymentContext>
                    <PaymentRequestId>456xyz</PaymentRequestId>
                    <CreateTimeStamp>2016-02-12T23:08:20+00:00</CreateTimeStamp>
                    <Amount>12.34</Amount>
                    <Authorization>
                        <ResponseCode>APPROVED</ResponseCode>
                        <BankAuthorizationCode>123456</BankAuthorizationCode>
                        <CVV2ResponseCode>M</CVV2ResponseCode>
                        <AVSResponseCode>AM</AVSResponseCode>
                        <PhoneResponseCode>U</PhoneResponseCode> <!-- see NOTE1 --> 
                        <NameResponseCode>Y</NameResponseCode> <!-- see NOTE2 --> 
                        <EmailResponseCode>N</EmailResponseCode> <!-- see NOTE3 --> 
                        <AmountAuthorized>12.34</AmountAuthorized>
                    </Authorization>
                    <ExpirationDate>2021-01</ExpirationDate>
                </CreditCard>
            </Payments>
        </Payment>
        ...
    </Order>
    ...
</OrderCreateRequest>
NOTE1 The extra required PhoneResponseCode for Amex cards.
NOTE2 The extra required NameResponseCode for Amex cards.
NOTE3 The extra required EmailResponseCode for Amex cards.

PayPal

PayPal can be a payment method and shares some information from PayPalDoAuthorizationReply. See mapping.

Copy
<OrderCreateRequest xmlns="http://api.gsicommerce.com/schema/checkout/1.0"
        requestId="123456789">
    <Order customerOrderId="12345">
        ...
        <Payment>
            ...
            <Payments>
                <PayPal>
                    <Amount>12.34</Amount> <!-- see NOTE1 --> 
                    <AmountAuthorized>12.34</AmountAuthorized> 
            <!-- see NOTE2 --> 
                    <PaymentContext>
                        <PaymentSessionId>123456</PaymentSessionId> 
            <!-- see NOTE3 --> 
                        <TenderType>PY</TenderType> <!-- see NOTE4 --> 
                        <PaymentAccountUniqueId isToken="true">PAYPAL</PaymentAccountUniqueId> 
            <!-- see NOTE5 --> 
                    </PaymentContext>
                    <CreateTimeStamp>2016-02-01T04:58:34</CreateTimeStamp> <!-- see NOTE6 --> 
                    <PaymentRequestId>123456abcdef</PaymentRequestId> <!-- see NOTE7 --> 
                    <Authorization>
                        <ResponseCode>APPROVED</ResponseCode> <!-- see NOTE8 --> 
                    </Authorization>
                </PayPal>
            </Payments>
        </Payment>
        ...
    </Order>
    ...
</OrderCreateRequest>
NOTE1 The amount this payment method is for (should match with AmountAuthorized) (required).
NOTE2 The amount authorized to use this payment method for (should match with Amount) (required).
NOTE3 The PaymentSessionId should always be the orderId (required).
NOTE4 The TenderType should be PY, for PayPal (required).
NOTE5 The PaymentAccountUniqueId should have isToken set to true and the value PAYPAL (required).
NOTE6 The time this payment was authorized (required).
NOTE7 The PaymentRequestId is the same as you sent in the PayPalDoAuthorizationRequest (required).
NOTE8 The ResponseCode should be APPROVED if the response code from PayPalDoAuthorizationReply was Success, otherwise the payment method shouldn’t be used (required).

StoredValueCard Gift Card

Stored value cards like physical gift cards or online gift cards can be used as payment methods. A stored value card should only be used if a StoredValueRedeemReply returned a Success response code. See mapping.

Copy
<OrderCreateRequest xmlns="http://api.gsicommerce.com/schema/checkout/1.0"
        requestId="123456789">
    <Order customerOrderId="12345">
        ...
        <Payment>
            ...
            <Payments>
                <StoredValueCard>
                    <PaymentContext>
                        <PaymentSessionId>123456</PaymentSessionId> <!-- see NOTE1 --> 
                        <TenderType>SP</TenderType> <!-- see NOTE2 --> 
                        <PaymentAccountUniqueId isToken="true">123abc</PaymentAccountUniqueId>  
                    </PaymentContext>
                    <PaymentRequestId>456xyz</PaymentRequestId> <!-- see NOTE3 -->  
                    <CreateTimeStamp>2016-02-17T18:02:28+00:00</CreateTimeStamp> 
            <!-- see NOTE4 -->  
                    <Pin>1234</Pin> <!-- see NOTE5 -->  
                    <Amount>12.34</Amount> <!-- see NOTE6 -->  
                </StoredValueCard>
            </Payments>
        </Payment>
        ...
    </Order>
    ...
</OrderCreateRequest>
NOTE1 The PaymentSessionId should always be the orderId (required).
NOTE2 The tender type for a gift card is provider specific (required).
NOTE3 The PaymentAccountUniqueId comes from the StoredValueRedeemReply (required). See mapping.
NOTE4 The time this payment was authorized (required).
NOTE5 The code associated with the gift card or gift certificate.
NOTE6 The amount being redeemed on the stored value card (required).