Initialize
API Reference
This page and its subpages provide API reference for Velocity API's Initialize (initialize-payment
) operation. See Initialize sample code below, and find Initialize parameter descriptions in the Request Parameters and Response Parameters subpages. For information on how to integrate this operation, see API.
Request
Endpoint: /mpoint/initialize-payment
Method: POST
Find sample code for the Initialize request below. For descriptions of Initialize request parameters, see the following sections in the Request Parameters subpage:
Sample Request
See the sample request below:
<root>
<initialize-payment account="[integer]" client-id="[integer]">
<transaction order-no="testOrderId1" type-id="[integer]" session-id="[integer]" product-type="[integer]" booking-ref="[PNR]">
<amount country-id="[integer]" currency-id="[integer]">100</amount>
<callback-url> [merchant callback url] </callback-url>
<accept-url>[merchant accept url</accept-url>
<cancel-url />
<decline-url />
<auth-url />
<hmac>76f8682b42d0de9ad6948d1a8aef1744b939cd0570cd2c9749173b</hmac>
<additional-data>
<param name="merchant_payment_ref">12091201291</param>
</additional-data>
</transaction>
<auth-token>profilesuccessvalidation</auth-token>
<client-info language="en" sdk-version="2.1.0" version="2.1.0" platform="[platform type]" profileid="[integer]">
<mobile operator-id="[integer]" country-id="[integer]"> [mobile number] </mobile>
<email> [email id] </email>
<device-id>ABCdefr6732</device-id>
</client-info>
</initialize-payment>
</root>
Sample Request with Display Order Data and Airline Itinerary Data (AID)
<?xml version="[integer]" encoding="UTF-8"?>
<root>
<initialize-payment account="[integer]" client-id="[integer]">
<transaction order-no="[string]" type-id="[integer]">
<amount currency-id="[integer]" country-id="[integer]">40180</amount>
<orders>
<shipping-address>
<name>name</name>
<street>street address</street>
<street2>additional street address</street2>
<city>city</city>
<state>NY</state>
<zip>411028</zip>
<country>India</country>
</shipping-address>
<line-item>
<product sku="PR-SAEF-11">
<name>single journey</name>
<description>single journey</description>
<image-url>[image URL]</image-url>
<airline-data order-type="TICKET" order-no="[string]">
<amount decimals="[integer]" currency-id="[integer]" currency="PHP" symbol="" format="" country-id="640">638500</amount>
<fees>
<fee format="" symbol="" currency="PHP" country-id="640" type-id="2">112300</fee>
</fees>
<trips>
<trip seq="1" tag="1">
<service-level>Economy</service-level>
<origin time-zone="+08:00" country-id="640" external-id="MNL" type-id="8">Manila</origin>
<destination time-zone="+08:00" country-id="640" external-id="BCD" type-id="8">Bacolod</destination>
<departure-time>2020-02-21 08:15:00</departure-time>
<arrival-time>2020-02-21 09:35:00</arrival-time>
<booking-class>H</booking-class>
<transportation code="">
<vehicle type="[integer]" id="[integer]">321</vehicle>
<carriers>
<carrier type-id="1" code="PR">
<number>2131</number>
</carrier>
<carrier type-id="[integer]" code="PR">
<number>2131</number>
</carrier>
</carriers>
</transportation>
</trip>
</trips>
<profiles>
<profile id="[integer]">
<title>MR</title>
<first-name>test</first-name>
<last-name>one</last-name>
<type>ADULT</type>
<amount decimals="2" currency-id="608" currency="[string]" symbol="" format="" country-id="640">638500</amount>
<contact-info>
<email>[email id]</email>
<mobile country-id="[integer]">[phone number]</mobile>
</contact-info>
</profile>
</profiles>
<billing-summary>
<fare-detail>
<fare>
<profile-seq>1</profile-seq>
<description>adult</description>
<currency>PHP</currency>
<amount>60</amount>
<product-code>ABF</product-code>
<product-category>FARE</product-category>
<product-item>Base fare for adult</product-item>
</fare>
</fare-detail>
<add-ons>
<add-on>
<profile-seq>1</profile-seq>
<trip-tag>2</trip-tag>
<trip-seq>2</trip-seq>
<description>adult</description>
<currency>PHP</currency>
<amount>60</amount>
<product-code>ABF</product-code>
<product-category>FARE</product-category>
<product-item>Base fare for adult</product-item>
</add-on>
</add-ons>
</billing-summary>
</airline-data>
</product>
<amount>638500</amount>
<points>200</points>
<reward>1</reward>
<quantity>1</quantity>
<additional-data>
<param name="deviceFingerPrint">12091201291</param>
</additional-data>
</line-item>
</orders>
<hmac>76f8682b42d0de9ad6948d1a8aef1744b939cd0570cd2c9749173b</hmac>
<additional-data>
<param name="merchant_payment_ref">12091201291</param>
</additional-data>
</transaction>
<client-info language="en" platform="Android/9(28)" version="2.00" app-id="2">
<mobile country-id="[integer]">99065528</mobile>
<email>[email id]</email>
<device-id>c2f-60-45e-8f7-83a4</device-id>
</client-info>
</initialize-payment>
</root>
Response
Sample code for the Initialize API response is below. For response parameter descriptions, see the following sections in the Response Parameters subpage:
Sample Response
Below is a sample Initialize response containing several possible forms of payment data:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<client-config account="100500" auto-capture="false" enable-cvv="true" id="10050" max-stored-cards="-1" mode="1" store-card="0">
<name>CPD Demo</name>
<callback-url>[callback url]</callback-url>
<accept-url>[accept url]</accept-url>
<cancel-url>[cancel url]</cancel-url>
<app-url>[app url]<app-url>
<css-url>[css url]</css-url>
<logo-url>[logo url]</logo-url>
<base-image-url>[base image url]</base-image-url>
<additional-config>
<property name="isAutoRedirect">true</property>
<property name="IS_LEGACY">false</property>
</additional-config>
<accounts>
<account id="[integer]" markup="spa" />
<account id="[integer]" markup="b2b-html5" />
</accounts>
</client-config>
<transaction auto-capture="false" eua-id="-1" id="[integer]" language="en" mode="1" order-no="TEST123" type-id="1">
<amount alpha2code="US" alpha3code="USA" code="840" country-id="200" currency="USD" currency-id="840" decimals="2" format="{CURRENCY}{PRICE}" symbol="$">5000</amount>
<mobile country-id="[integer]" operator-id="[integer]">30206172</mobile>
<callback-url>[callback url]</callback-url>
<accept-url>[accept url]</accept-url>
<cancel-url>[cancel url]</cancel-url>
</transaction>
<session id="[integer]" total-amount="5000" type="1">
<amount alpha2code="US" alpha3code="USA" code="840" country-id="200" currency="USD" currency-id="840" format="{CURRENCY}{PRICE}" symbol="$">5000</amount>
<status>4001</status>
</session>
<cards>
<card cvc-length="4" cvcmandatory="false" dcc="false" enabled="true" id="1" installment="0" max-length="15" min-length="15" payment-type="1" preferred="false" presentment-currency="false" processor-type="1" psp-id="-1" state-id="1" type-id="1">
<name>American Express</name>
<prefixes>
<prefix id="395">
<min>34</min>
<max>34</max>
</prefix>
<prefix id="396">
<min>37</min>
<max>37</max>
</prefix>
</prefixes>American Express
</card>
<card cvc-length="3" cvcmandatory="false" dcc="false" enabled="true" id="7" installment="0" max-length="16" min-length="16" payment-type="1" preferred="false" presentment-currency="false" processor-type="1" psp-id="-1" state-id="1" type-id="7">
<name>Master Card</name>
<prefixes>
<prefix id="412">
<min>2221</min>
<max>2720</max>
</prefix>
<prefix id="413">
<min>51</min>
<max>55</max>
</prefix>
</prefixes>Master Card
</card>
<card cvc-length="3" cvcmandatory="false" dcc="false" enabled="true" id="8" installment="0" max-length="16" min-length="13" payment-type="1" preferred="false" presentment-currency="false" processor-type="1" psp-id="-1" state-id="1" type-id="8">
<name>VISA</name>
<prefixes>
<prefix id="414">
<min>4</min>
<max>4</max>
</prefix>
</prefixes>VISA
</card>
<card cvc-length="3" cvcmandatory="false" dcc="false" enabled="true" id="22" installment="0" max-length="19" min-length="16" payment-type="1" preferred="false" presentment-currency="false" processor-type="1" psp-id="-1" state-id="1" type-id="22">
<name>Discover</name>
<prefixes>
<prefix id="422">
<min>6011</min>
<max>6011</max>
</prefix>
<prefix id="423">
<min>644</min>
<max>659</max>
</prefix>
<prefix id="424">
<min>65</min>
<max>65</max>
</prefix>
</prefixes>Discover
</card>
<card cvc-length="3" cvcmandatory="false" dcc="false" enabled="true" id="3" installment="0" max-length="19" min-length="14" payment-type="1" preferred="false" presentment-currency="false" processor-type="1" psp-id="-1" state-id="1" type-id="3">
<name>Diners Club</name>
<prefixes>
<prefix id="397">
<min>36</min>
<max>36</max>
</prefix>
<prefix id="398">
<min>38</min>
<max>39</max>
</prefix>
<prefix id="399">
<min>300</min>
<max>305</max>
</prefix>
<prefix id="400">
<min>3095</min>
<max>3095</max>
</prefix>
</prefixes>Diners Club
</card>
</cards>
<stored-cards>
<card id="[integer]" preferred="true" psp-id="2" type-id="2" dcc="true">
<name>myVisa</name>
<card-number-mask>4711 10** **** 0000</card-number-mask>
<expiry>06/24</expiry>
</card>
</stored-cards>
<wallets>
<card cvc-length="-1" cvcmandatory="false" dcc="false" enabled="true" id="41" installment="0" max-length="-1" min-length="-1" payment-type="3" preferred="false" presentment-currency="false" processor-type="3" psp-id="-1" state-id="1" type-id="41">
<name>Google Pay</name>
<prefixes>
<prefix id="200">
<min>-1</min>
<max>-1</max>
</prefix>
<prefix id="202">
<min>-1</min>
<max>-1</max>
</prefix>
</prefixes>
<url method="overlay"/>
<head><script>var baseRequest={apiVersion: 2, apiVersionMinor: 0 };var allowedCardAuthMethods=['PAN_ONLY','CRYPTOGRAM_3DS'];var allowedCardNetworks=['MASTERCARD','DISCOVER','VISA','AMEX'];var assuranceDetailsRequired=true;var tokenizationSpecification={type:'PAYMENT_GATEWAY',parameters:{'gateway':'cellpointmobile','gatewayMerchantId':'10106'}};var baseCardPaymentMethod={type:'CARD',parameters:{allowedAuthMethods:allowedCardAuthMethods,allowedCardNetworks:allowedCardNetworks,assuranceDetailsRequired:assuranceDetailsRequired}};var cardPaymentMethod=Object.assign({},baseCardPaymentMethod,{tokenizationSpecification:tokenizationSpecification});let paymentsClient=null;function getGoogleIsReadyToPayRequest(){return Object.assign({},baseRequest,{allowedPaymentMethods:[baseCardPaymentMethod]})} function getGooglePaymentDataRequest(){var paymentDataRequest=Object.assign({},baseRequest);paymentDataRequest.allowedPaymentMethods=[cardPaymentMethod];paymentDataRequest.transactionInfo=getGoogleTransactionInfo();paymentDataRequest.merchantInfo={ merchantName:'Virgin Holidays'};return paymentDataRequest} function getGooglePaymentsClient(){if(paymentsClient===null){return(new google.payments.api.PaymentsClient({environment:'TEST'}));}} function getGoogleTransactionInfo(){return{countryCode:'GB',currencyCode:'GBP',totalPriceStatus:'FINAL',totalPrice:'152.00'}}</head>
<body><script async="true" src="https://myurl/js/googlepay.js"></script> <script async="true" src="https://pay.google.com/gp/p/js/pay.js"></script></body>
<auth-token>Auth-Token</auth-token>
</card>
<card cvc-length="-1" cvcmandatory="false" dcc="false" enabled="true" id="15" installment="0" max-length="-1" min-length="-1" payment-type="3" preferred="false" presentment-currency="false" processor-type="3" psp-id="-1" state-id="1" type-id="15">
<name>Apple Pay</name> //Apple Pay for WEB channel
<prefixes>
<prefix id="164">
<min>-1</min>
<max>-1</max>
</prefix>
</prefixes>
<url method="overlay"/>
<head><script type='text/javascript'> var debug = false; var countryCode = "GB"; var currencyCode = "GBP"; var merchantIdentifier = 'merchant.mytest.applepay.sandbox'; var displayName ="Holidays"; var totalAmount = "152"; var supportedNetword = ['VISA','DISCOVER','MASTERCARD','AMEX']; var supportedNetwork = ['VISA','DISCOVER','MASTERCARD','AMEX']; </script> <script type="text/javascript" src="https://myurl/js/applepay.js"></script> <style> #applePay{width:150px;height:50px;display:none;border-radius:5px;background-image:-webkit-named-image(apple-pay-logo-white);background-position:50% 50%;background-color:#000;background-size:60%;background-repeat:no-repeat} </style></head>
<body><button type="button" id="applePay"></button></body>
<auth-token>Auth-Token</auth-token>Apple Pay
</card>
<card id="15" type-id="15" psp-id="52" min-length="-1" max-length="-1" cvc- length="-1" state-id="1" payment-type="3" preferred="false" enabled="true" processor-type="3" installment="0" cvcmandatory="false" dcc="false" presentment-currency="false">
<name>Apple Pay</name> // Apple Pay for Native APP channel
<prefixes>
<prefix>
<min>0</min>
<max>0</max>
</prefix>
</prefixes>
<url method="overlay"/>
<hidden-fields>
<card-brands>'MASTERCARD','VISA','DISCOVER','AMEX'</card-brands>
</hidden-fields>
<auth-token>Auth-Token</auth-token>Apple Pay
</card>
</wallets>
<apms>
<card cvc-length="-1" cvcmandatory="false" dcc="false" enabled="true" id="28" installment="0" max-length="-1" min-length="-1" payment-type="4" preferred="false" presentment-currency="false" processor-type="4" psp-id="-1" state-id="1" type-id="28">
<name>PayPal</name>
<prefixes>
<prefix id="181">
<min>-1</min>
<max>-1</max>
</prefix>
</prefixes>PayPal
</card>
</apms>
<aggregators>
<card cvc-length="0" cvcmandatory="false" dcc="false" enabled="true" id="97" installment="0" max-length="0" min-length="0" payment-type="7" preferred="false" presentment-currency="false" processor-type="7" psp-id="-1" state-id="1" type-id="97">
<name>PSE</name>
<prefixes/>
<active-payment-methods>
<payment-method>
<logoName>8f56c0c2-c2ac-4b25-9d64-849101aa512b</logoName>
<logoURL>0</logoURL>
<displayName>A continuación seleccione su banco</displayName>
<issuingBank>0</issuingBank>
<displayOrder>1</displayOrder>
</payment-method>
<payment-method>
<logoName>2c9c848b-a02b-4aa5-bc49-6695e28f7517</logoName>
<logoURL>1552</logoURL>
<displayName>BAN.CO</displayName>
<issuingBank>1552</issuingBank>
<displayOrder>2</displayOrder>
</payment-method>
</active-payment-methods>
</card>
</aggregators>
<offline>
<card cvc-length="0" cvcmandatory="false" dcc="false" enabled="true" id="96" installment="0" max-length="0" min-length="0" payment-type="8" preferred="false" presentment-currency="false" processor-type="8" psp-id="-1" state-id="1" type-id="96">
<name>Payment Center Offline</name>
<prefixes/>
</card>
</offline>
<vouchers>
<card id="26" type-id="26" psp-id="-1" min-length="-1" max-length="-1" cvc-length="-1" state-id="1" payment-type="2" preferred="false" enabled="true" processor-type="2" installment="0" cvcmandatory="false" dcc="false" presentment-currency="false">
<name>TravelFund</name>
<prefixes>
<prefix id="273">
<min>-1</min>
<max>-1</max>
</prefix>
</prefixes>
</card>
<card id="24" type-id="24" psp-id="-1" min-length="-1" max-length="-1" cvc-length="-1" state-id="1" payment-type="2" preferred="false" enabled="true" processor-type="2" installment="0" cvcmandatory="false" dcc="false" presentment-currency="false">
<name>Invoice</name>
<prefixes>
<prefix id="178">
<min>-1</min>
<max>-1</max>
</prefix>
<prefix id="180">
<min>-1</min>
<max>-1</max>
</prefix>
</prefixes>
</card>
</vouchers>
<paylater />
<upi />
</root>
Split Payment: Sample Response for First Initialize
The code below is an example of an Initialize response for a split payment:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<client-config account="[integer]" auto-capture="false" id="[integer]" mode="[integer]" store-card="[integer]">
<name>Test</name>
<callback-url>[callback url]</callback-url>
<accept-url/>
</client-config>
<transaction auto-capture="true" eua-id="[integer]" id="[integer]" language="en" mode="1" order-no="" type-id="[integer]">
<amount country-id="[integer]" currency="USD" format="{CURRENCY}{PRICE}" symbol="$">10025</amount>
<mobile country-id="[integer]" operator-id="[integer]">30206172</mobile>
<callback-url>[CALLBACK URL]</callback-url>
<accept-url/>
</transaction>
<session id="[integer]" total-amount="10025" type="1">
<amount alpha2code="US" alpha3code="USA" code="840" country-id="200" currency="USD" currency-id="840" format="{CURRENCY}{PRICE}" symbol="$">10025</amount>
<status>4001</status>
</session>
<split_payment>
<configuration>
<applicable_combinations>
<combination>
<payment_type>
<id>1</id>
<sequence>1</sequence>
</payment_type>
<payment_type>
<id>2</id>
<sequence>2</sequence>
</payment_type>
<is_one_step_authorization>true</is_one_step_authorization>
</combination>
<combination>
<payment_type>
<id>1</id>
<sequence>1</sequence>
</payment_type>
<payment_type>
<id>1</id>
<sequence>2</sequence>
</payment_type>
<is_one_step_authorization>false</is_one_step_authorization>
</combination>
</applicable_combinations>
</configuration>
</split_payment>
<cards>
<card cvc-length="3" cvcmandatory="false" dcc="false" enabled="true" id="8" instalment="0" max-length="19" min-length="13" payment-type="1" preferred="false" processor-type="1" psp-id="21" state-id="1" type-id="8">
<name>Visa</name>
<prefixes>
<prefix>
<min>4000</min>
<max>4999</max>
</prefix>
<prefix>
<min>413222</min>
<max>413222</max>
</prefix>
</prefixes>Visa
</card>
<card cvc-length="-1" cvcmandatory="false" dcc="true" enabled="true" id="28" installment="0" max-length="-1" min-length="-1" payment-type="4" preferred="false" presentment-currency="false" processor-type="4" psp-id="24" state-id="1" type-id="28">
<name>[PSP]</name>
<prefixes>
<prefix>
<min>0</min>
<max>0</max>
</prefix>
</prefixes>[PSP name]
</card>
</cards>
<vouchers>
<card cvc-length="-1" cvcmandatory="false" dcc="false" enabled="true" id="26" installment="0" max-length="-1" min-length="-1" payment-type="2" preferred="false" presentment-currency="false" processor-type="2" psp-id="-1" state-id="1" type-id="26">
<name>TravelFund</name>
<prefixes>
<prefix id="337">
<min>-1</min>
<max>-1</max>
</prefix>
</prefixes>TravelFund
</card>
</vouchers>
</root>
Split Payment: Sample Response for Subsequent Initialize
The code below is an example of a subsequent Initialize response for a split payment:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<client-config account="[integer]" auto-capture="false" id="[integer]" mode="[integer]" store-card="[integer]">
<name>Test</name>
<callback-url>[callback url]</callback-url>
<accept-url/>
</client-config>
<transaction auto-capture="true" eua-id="[integer]" id="[integer]" language="en" mode="1" order-no="" type-id="[integer]">
<amount country-id="[integer]" currency="USD" format="{CURRENCY}{PRICE}" symbol="$">10025</amount>
<mobile country-id="[integer]" operator-id="[integer]">30206172</mobile>
<callback-url>[CALLBACK URL]</callback-url>
<accept-url/>
</transaction>
<session id="[integer]" total-amount="10025" type="1">
<amount alpha2code="US" alpha3code="USA" code="840" country-id="200" currency="USD" currency-id="840" format="{CURRENCY}{PRICE}" symbol="$">5000</amount>
<status>4031</status>
</session>
<split_payment>
<active_split>
<current_split_sequence>2</current_split_sequence>
<transactions>
<transaction>
<payment_type>1</payment_type>
<id>5297575</id>
<sequence>1</sequence>
</transaction>
</transactions>
</active_split>
<configuration>
<applicable_combinations>
<combination>
<payment_type>
<id>1</id>
<sequence>1</sequence>
</payment_type>
<payment_type>
<id>2</id>
<sequence>2</sequence>
</payment_type>
<is_one_step_authorization>true</is_one_step_authorization>
</combination>
<combination>
<payment_type>
<id>1</id>
<sequence>1</sequence>
</payment_type>
<payment_type>
<id>1</id>
<sequence>2</sequence>
</payment_type>
<is_one_step_authorization>false</is_one_step_authorization>
</combination>
</applicable_combinations>
</configuration>
</split_payment>
<cards>
<card cvc-length="3" cvcmandatory="false" dcc="false" enabled="true" id="8" instalment="0" max-length="19" min-length="13" payment-type="1" preferred="false" processor-type="1" psp-id="21" state-id="1" type-id="8">
<name>Visa</name>
<prefixes>
<prefix>
<min>4000</min>
<max>4999</max>
</prefix>
<prefix>
<min>413222</min>
<max>413222</max>
</prefix>
</prefixes>Visa</card>
<card cvc-length="-1" cvcmandatory="false" dcc="true" enabled="true" id="28" installment="0" max-length="-1" min-length="-1" payment-type="4" preferred="false" presentment-currency="false" processor-type="4" psp-id="24" state-id="1" type-id="28">
<name>[PSP]</name>
<prefixes>
<prefix>
<min>0</min>
<max>0</max>
</prefix>
</prefixes>[PSP name]
</card>
</cards>
<vouchers>
<card cvc-length="-1" cvcmandatory="false" dcc="false" enabled="true" id="26" installment="0" max-length="-1" min-length="-1" payment-type="2" preferred="false" presentment-currency="false" processor-type="2" psp-id="-1" state-id="1" type-id="26">
<name>TravelFund</name>
<prefixes>
<prefix id="337">
<min>-1</min>
<max>-1</max>
</prefix>
</prefixes>TravelFund
</card>
</vouchers>
</root>
Updated 10 days ago