Payment account migration to a new MID

It is possible to migrate an already existing card payment account from one MerchantID to another. Please note this is possible via both integration types (FrontEnd2Backend and Backend2Backend), but if certain details need to be updated (most notably the CVC of the card) before initiating a payment an API V4 call to update the already existing payment account needs to be done before the copy is created.

User flow

An already existing account can be updated before a copy is done(if needed), because the copying process can't simultaneously update payment account details as well:

  1. Get token observing the Validations and IPv6 restriction
  2. Update an existing payment account if needed
  3. Copy the payment account over to a new MID. Please note this call will copy the account and will initiate a payment with the new account simultaneously.

Obtaining a token before updating an already existing account

GET /api/v4/tokens?mid=<SourceMerchant>&sid=<SourceShop>&uid=<SourceUser>&uip=<RequestorIP>&mtid=<TXNID> HTTP/1.1
Host: test.backend.cqrpayments.com
Content-Type: application/json
Accept: application/json
Authorization: Basic <BasicAuthCredentials>
{
    "token": <Token>
}
Reference fieldRemark
SourceMerchantThe ID of the merchant that the account will be copied from
SourceShopA shop id belonging to the source merchant
SourceUserThe user id to which the account that needs to be copied belongs
RequestorIPThe publicIP of the machine sending the request. If a requestor has multiple public IPs the Validations and IPv6 restrictions need to be taken into account.
TXNIDTransactionID
BasicAuthCredentialsBasic authentication system credentials for PaymentService
TokenJSON string. It’s a token with which to authenticate the second request.

Updating an already existing account before migrating it

An update to the already existing account might not be needed, but generally the CVC will need to be updated for a card payment before the payment account is migrated to a new merchant. This is only valid for account types 1 (Credit card) and 17 (Debit card).

POST /api/v4/merchants/<SourceMerchant>/users/<SourceUser>/accounts/<PAID>?token=<Token> HTTP/1.1
Host: test.backend.cqrpayments.com
Content-Type: application/json
Accept: application/json
Authorization: Basic <BasicAuthCredentials>
{"cardVerificationCode":"<CVC>","visible":"True","active":null,"reason":"Set CVC before cloning.","type":1}
{
    "accounts": [
        {
            "cardNumber": "************2205",
            "expiryMonth": 12,
            "expiryYear": 2025,
            "holderName": "",
            "cardToken": "72500ae7-59be-46ae-b349-1c7d1d148f7b",
            "issuerCountryCode": "US",
            "issuerName": null,
            "accountFundingSource": "Credit",
            "cardType": "Mastercard",
            "id": "09c051b7-a3be-4ff8-a76a-f629226f4fcd",
            "paymentAccountTypeID": 1,
            "paymentMethodID": 0
        }
    ]
}
Reference fieldRemark
SourceMerchantSame as above
SourceUserSame as above
PAIDThe PaymentAccountID of the original account (the one that will be copied over)
TokenThe token received in the previous request
CVCThe CVC that needs to be updated

Please note: other details can be updated too. Please see Updates an existing payment account for additional information

Copy of an already existing account to a new MID and initiating a payment with it

Once an account has been updated (if needed) it can be copied over to a new MID

POST /PaymentRedirectionService/PaymentService.svc/pox/initiatePayment HTTP/1.1
Host: test.backend.cqrpayments.com
Authorization: Basic <BasicAuthCredentials>
Content-Type: text/xml
Accept: text/xml
<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentRequest xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns=http://www.cqrpayments.com/PaymentProcessing>
                <merchantID><TargetMerchant></merchantID>
                <shopID><TargetShop></shopID>
                <merchantTransactionID>da010381-9d05-417c-85f1-0cad2c68c1f7</merchantTransactionID>
                <paymentMethodID>1</paymentMethodID>
                <amount currencyCode="EUR">13.11</amount>
                <userID><TargetUser></userID>
                <userIP>127.0.0.1</userIP>
                <userSessionID>10379a77-b48d-4169-b102-df594ef4f377</userSessionID>
                <creationTypeID>1</creationTypeID>
                <specificPaymentData>
                                <data xsi:type="keyStringValuePair">
                                                <key>PaymentDescription</key>
                                                <value>815d542b-78b8-4902-b429-8d4b5b8b6168</value>
                                </data>
                                <data xsi:type="keyStringValuePair">
                                                <key>PaymentDescriptionLanguageCode</key>
                                                <value>en</value>
                                </data>
                                <data xsi:type="keyStringValuePair">
                                                <key>PaymentAccountReferenceMerchantID</key>
                                                <value><SourceMerchant></value>
                                </data>
        <data xsi:type="keyStringValuePair">
                                                <key>PaymentAccountReferenceUserID</key>
                                                <value><SourceUser></value>
                                </data>
                </specificPaymentData>
                <paymentAccountID><PAID></paymentAccountID>
</initiatePaymentRequest>
Reference fieldRemark
TargetMerchantThe merchant to which the account is copied and which will initiate the payment
TargetShopThe shop which will initiate the payment
TargetUserThe userID to which the account will be copied
SourceMerchantThe merchant from which the account is copied
SourceUserThe user to which the account that is being copied belongs
BasicAuthCredentialsBasic authentication system credentials for PaymentService
PAIDThe PaymentAccountID of the original account (it will be copied over to the new merchant with the same ID)

Please note: once an account has been copied over it can be treated as every other payment account and can be updated with subsequent initiatePayment requests. Only the initial request that copies the account over to a new merchant is restricted to not be able to update as well.