Generate a transaction
1. XML Structure
Regardless of the transaction type, the basic XML document structure of a credit/debit card transaction is as follows:
<ipgapi:IPGApiOrderRequest
xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1"
xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi">
<v1:Transaction>
<v1:CreditCardTxType>...</v1:CreditCardTxType>
<v1:CreditCardData>...</v1:CreditCardData>
<v1:Payment>...</v1:Payment>
<v1:TransactionDetails>...</v1:TransactionDetails>
<v1:Billing>...</v1:Billing>
<v1:Shipping>...</v1:Shipping>
</v1:Transaction>
</ipgapi:IPGApiOrderRequest
The element CreditCardDataTXType
is mandatory for all credit card transactions. The other elements depend on the transaction type. The transaction content is type-specific.
The elements in XML structure must be kept in the same order as shown in examples, otherwise the OrderRequest will fail.
2. Sale transaction
The following XML document represents an example of a Sale transaction using the minimum set of elements:
<ipgapi:IPGApiOrderRequest
xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1"
xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi">
<v1:Transaction>
<v1:CreditCardTxType>
<v1:Type>sale</v1:Type>
</v1:CreditCardTxType>
<v1:CreditCardData>
<v1:CardNumber>4111********1111</v1:CardNumber>
<v1:ExpMonth>12</v1:ExpMonth>
<v1:ExpYear>27</v1:ExpYear>
</v1:CreditCardData>
<v1:Payment>
<v1:ChargeTotal>19.95</v1:ChargeTotal>
<v1:Currency>978</v1:Currency>
</v1:Payment>
</v1:Transaction>
</ipgapi:IPGApiOrderRequest>
See chapter Introduction: XML Schemata overview for a detailed description of all elements used in the above example as well as further optional elements.
The following XML document represents an example of a Sale transaction for API users handling multiple Store IDs:
<ipgapi:IPGApiOrderRequest
xmlns:ipgapi='http://ipg-online.com/ipgapi/schemas/ipgapi' xmlns:v1='http://ipg-online.com/ipgapi/schemas/v1'>
<v1:Transaction>
<v1:CreditCardTxType>
<v1:StoreId>123****890</v1:StoreId>
<v1:Type>sale</v1:Type>
</v1:CreditCardTxType>
<v1:CreditCardData>
<v1:CardNumber>4111******1111</v1:CardNumber>
<v1:ExpMonth>12</v1:ExpMonth>
<v1:ExpYear>27</v1:ExpYear>
<v1:CardCodeValue>XXX</v1:CardCodeValue>
</v1:CreditCardData>
<v1:Payment>
<v1:ChargeTotal>15.00</v1:ChargeTotal>
<v1:Currency>978</v1:Currency>
</v1:Payment>
<v1:TransactionDetails>
<v1:OrderId>12-34-56</v1:OrderId>
<v1:MerchantTransactionId>AB500500</v1:MerchantTransactionId>
<v1:TransactionOrigin>ECI</v1:TransactionOrigin>
<v1:DynamicMerchantName>MyWebsite</v1:DynamicMerchantName>
</v1:TransactionDetails>
<v1:Billing>
<v1:Zip>0001</v1:Zip>
</v1:Billing>
</v1:Transaction>
</ipgapi:IPGApiOrderRequest>
3. Pre-Authorisation
The following XML document represents an example of a PreAuth transaction using the minimum set of elements:
<ipgapi:IPGApiOrderRequest
xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1"
xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi">
<v1:Transaction>
<v1:CreditCardTxType>
<v1:Type>preAuth</v1:Type>
</v1:CreditCardTxType>
<v1:CreditCardData>
<v1:CardNumber>4111********1111</v1:CardNumber>
<v1:ExpMonth>12</v1:ExpMonth>
<v1:ExpYear>27</v1:ExpYear>
</v1:CreditCardData>
<v1:Payment>
<v1:ChargeTotal>100.00</v1:ChargeTotal>
<v1:Currency>978</v1:Currency>
</v1:Payment>
</v1:Transaction>
</ipgapi:IPGApiOrderRequest>
4. Post-Authorisation
The following XML document represents an example of a PostAuth transaction using the minimum set of elements:
<ipgapi:IPGApiOrderRequest
xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1"
xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi">
<v1:Transaction>
<v1:CreditCardTxType>
<v1:Type>postAuth</v1:Type>
</v1:CreditCardTxType>
<v1:Payment>
<v1:ChargeTotal>59.00</v1:ChargeTotal>
<v1:Currency>978</v1:Currency>
</v1:Payment>
<v1:TransactionDetails>
<v1:OrderId>03d2723-99b6-4559-8c6d-79748</v1:OrderId>
</v1:TransactionDetails>
</v1:Transaction>
</ipgapi:IPGApiOrderRequest>
In case your system is not aware of the payment method that has been used for the original Pre-Authorisation transaction, the Post-Authorisation can be performed using any TxType which supports Post-Authorisations. The Gateway will then select the correct payment method based on the referenced Order ID.
5. Return
The following XML document represents an example of a Return transaction using the minimum set of elements:
<ipgapi:IPGApiOrderRequest
xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1"
xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi">
<v1:Transaction>
<v1:CreditCardTxType>
<v1:Type>return</v1:Type>
</v1:CreditCardTxType>
<v1:Payment>
<v1:ChargeTotal>19.00</v1:ChargeTotal>
<v1:Currency>978</v1:Currency>
</v1:Payment>
<v1:TransactionDetails>
<v1:OrderId>62e3b5df-2911-4e89-8356-1e49302b1807</v1:OrderId>
</v1:TransactionDetails>
</v1:Transaction>
</ipgapi:IPGApiOrderRequest>
In case your system is not aware of the payment method that has been used for the original transaction, the "Return" can be performed using any "TxType" which supports Returns. The Gateway will then select the correct payment method based on the referenced Order ID.
6. Credit
Please note that Credit is a transaction type that requires special user permissions.
The following XML document represents an example of a Credit transaction using the minimum set of elements:
<ipgapi:IPGApiOrderRequest
xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1"
xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi">
<v1:Transaction>
<v1:CreditCardTxType>
<v1:Type>credit</v1:Type>
</v1:CreditCardTxType>
<v1:CreditCardData>
<v1:CardNumber>4111********1111</v1:CardNumber>
<v1:ExpMonth>12</v1:ExpMonth>
<v1:ExpYear>27</v1:ExpYear>
</v1:CreditCardData>
<v1:Payment>
<v1:ChargeTotal>50.00</v1:ChargeTotal>
<v1:Currency>978</v1:Currency>
</v1:Payment>
</v1:Transaction>
</ipgapi:IPGApiOrderRequest>
7. Void
The following XML document represents an example of a Void transaction using the minimum set of elements:
<ipgapi:IPGApiOrderRequest
xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1"
xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi">
<v1:Transaction>
<v1:CreditCardTxType>
<v1:Type>void</v1:Type>
</v1:CreditCardTxType>
<v1:TransactionDetails>
<v1:IpgTransactionId>1234567890</v1:IpgTransactionId>
</v1:TransactionDetails>
</v1:Transaction>
</ipgapi:IPGApiOrderRequest>
For referencing to the transaction that shall be voided, this example uses the parameter IpgTransactionId
. If you have assigned a transaction ID (MerchantTransactionId
) in the original transaction, you can alternatively submit this ID as ReferencedMerchantTransactionId
instead.
In case your system is not aware of the payment method that has been used for the original transaction, the Void can be performed using any "TxType" which supports Voids. The Gateway will then select the correct payment method based on the referenced Order ID and Transaction Date.
Updated 29 days ago