cancel
Showing results for 
Search instead for 
Did you mean: 

Add multiple payment profile while creating customers

Using sandbox key and transaction id when I'm creating the user using json flavour. This api will response me the customerProfileId and customerPaymentProfileIdList in the list there is one one id. Can we create it multiples? if yes, Then what is the json string I have to send to generate multiple customerPaymentProfileIds. If no, Then please expalin why I'm not sending the array to the api. Or how to create the multiple payment profiles using authrization.net. 

3 REPLIES 3

Hi @puneetjindal30

 

You can create multiple PaymentProfiles while creating a CustomerProfile

 

So if you are making the createCustomerProfileRequest

then instead of sendin a single object in  paymentProfiles you can send multiple as an array, something similar to this

 

"paymentProfiles": [{
                "customerType": "individual",
                "payment": {
                    "creditCard": {
                        "cardNumber": "4111111111111111",
                        "expirationDate": "2020-12"
                    }
                }
            },{
                "customerType": "individual",
                "payment": {
                    "creditCard": {
                        "cardNumber": "4242424242424242",
                        "expirationDate": "2020-12"
                    }
                }
            }]

This will generate 2 payment profiles for the CustomerProfile, with different card numbers.

 

Hope this Helps!

Kaushik

kikmak42
Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert

Hi @kikmak42

 

 

I'm sending the  json like below and as you say sending multiple profile I'm also sending the multiple profiles see below json:-

{
  "createCustomerProfileRequest": {
    "merchantAuthentication": {
        "name": "name",
        "transactionKey": "transactionKey"
    },
    "refId": "1361101257555",
    "profile": {
        "merchantCustomerId": "2CLINC056",
        "description": "hiiiiii.",
        "email": "",
        "paymentProfiles": [
            {
                "customerType": "individual",
                "billTo": {
                    "firstName": "Joe",
                    "lastName": "Test",
                    "company": "CompanyA",
                    "address": "hello",
                    "city": "Bangalore",
                    "state": "Delhi",
                    "zip": "560078",
                    "country": "IN",
                    "phoneNumber": "415-555-1212",
                    "faxNumber": "415-555-1313"
                },
                "payment": {
                    "creditCard": {
                        "cardNumber": "370000000000002",
                        "expirationDate": "2029-12"
                    }
                }
            },
            {
                "customerType": "individual",
                "billTo": {
                    "firstName": "Joe",
                    "lastName": "Test",
                    "company": "CompanyA",
                    "address": "vel",
                    "city": "Chennai",
                    "state": "AK",
                    "zip": "560089",
                    "country": "US",
                    "phoneNumber": "415-555-1212",
                    "faxNumber": "415-555-1313"
                },
                "payment": {
                    "creditCard": {
                        "cardNumber": "38000000000006",
                        "expirationDate": "2029-12"
                    }
                }
            }
        ]
    },
    "validationMode": "testMode"
  }
}

Please tell me that what is the error in this json.

 

Thanks!

 

Puneet.

Hi @puneetjindal30

 

I tried with your json, and it gives me an error with the 2nd card number, as the account I have in sanbox didn't support Diners Club.

 

But when I changed both the card numbers to a VISA test card numbers, I got a successful response.

 

The error response I got initially

 

{
    "customerPaymentProfileIdList": [],
    "customerShippingAddressIdList": [],
    "validationDirectResponseList": [
        "1,1,1,(TESTMODE) This transaction has been approved.,000000,P,0,none,Test transaction for ValidateCustomerPaymentProfile.,1.00,CC,auth_only,2CLINC056,Joe,Test,CompanyA,hello,Bangalore,Delhi,560078,IN,415-555-1212,415-555-1313,,,,,,,,,,0.00,0.00,0.00,FALSE,none,8CDC5494AF4CB9545C05E36A78141BB9,,,,,,,,,,,,,XXXX0002,American Express,,,,,,,,,,,,,,,,,",
        "3,2,17,(TESTMODE) The merchant does not accept this type of credit card.,000000,P,0,none,Test transaction for ValidateCustomerPaymentProfile.,1.00,CC,auth_only,2CLINC056,Joe,Test,CompanyA,vel,Chennai,AK,560089,US,415-555-1212,415-555-1313,,,,,,,,,,0.00,0.00,0.00,FALSE,none,8CDC5494AF4CB9545C05E36A78141BB9,,,,,,,,,,,,,XXXX0006,Diners Club,,,,,,,,,,,,,,,,,"
    ],
    "refId": "1361101257555",
    "messages": {
        "resultCode": "Error",
        "message": [
            {
                "code": "E00027",
                "text": "(TESTMODE) The merchant does not accept this type of credit card."
            }
        ]
    }
}

 

The successful message

 

{
    "customerProfileId": "1917585050",
    "customerPaymentProfileIdList": [
        "1830796850",
        "1830796851"
    ],
    "customerShippingAddressIdList": [],
    "validationDirectResponseList": [
        "1,1,1,(TESTMODE) This transaction has been approved.,000000,P,0,none,Test transaction for ValidateCustomerPaymentProfile.,1.00,CC,auth_only,2CLINC056,Joe,Test,CompanyA,hello,Bangalore,Delhi,560078,IN,415-555-1212,415-555-1313,,,,,,,,,,0.00,0.00,0.00,FALSE,none,8CDC5494AF4CB9545C05E36A78141BB9,,,,,,,,,,,,,XXXX4242,Visa,,,,,,,,,,,,,,,,,",
        "1,1,1,(TESTMODE) This transaction has been approved.,000000,P,0,none,Test transaction for ValidateCustomerPaymentProfile.,1.00,CC,auth_only,2CLINC056,Joe,Test,CompanyA,vel,Chennai,AK,560089,US,415-555-1212,415-555-1313,,,,,,,,,,0.00,0.00,0.00,FALSE,none,8CDC5494AF4CB9545C05E36A78141BB9,,,,,,,,,,,,,XXXX4242,Visa,,,,,,,,,,,,,,,,,"
    ],
    "refId": "1361101257555",
    "messages": {
        "resultCode": "Ok",
        "message": [
            {
                "code": "I00001",
                "text": "Successful."
            }
        ]
    }
}

Hope this helps!
Kaushik