Re: Reqeust as json, but the api response as xml format

SokHorng
Occasional Visitor

Reqeust as json, but the api response as xml format

Hi, I have tried to request to merchant push payment api

https://sandbox.api.visa.com/visadirect/mvisa/v1/merchantpushpayments

request body in json format:

{
  "amount""124.05",
  "secondaryId""123TEST",
  "localTransactionDateTime""2023-03-25T02:56:26",
  "recipientPrimaryAccountNumber""4123640062698797",
  "cardAcceptor": {
    "address": {
      "country""IN",
      "city""KOLKATA"
    },
    "idCode""CA-IDCode-77765",
    "name""Visa Inc. USA-Foster City"
  },
  "senderReference""",
  "acquirerCountryCode""356",
  "acquiringBin""408972",
  "retrievalReferenceNumber""412770451035",
  "purchaseIdentifier": {
    "referenceNumber""REF_123456789123456789123",
    "type""0"
  },
  "systemsTraceAuditNumber""451035",
  "senderName""Jasper",
  "businessApplicationId""MP",
  "settlementServiceIndicator""9",
  "merchantCategoryCode""5812",
  "transactionCurrencyCode""356",
  "senderAccountNumber""4027290077881587"
}
 
But I got response in xml instead:
<?xml version='1.0' encoding='UTF-8'?>
<ns3:OctV2V2Response xmlns:ns3="http://www.visa.com/vpp/api/oct" xmlns:ns2="http://www.visa.com/vpp/api/dd">
    <transactionIdentifier>23423432</transactionIdentifier>
    <actionCode>00</actionCode>
    <approvalCode>21324K</approvalCode>
    <responseCode>5</responseCode>
    <transmissionDateTime>2023-03-27T10:26:15.000Z</transmissionDateTime>
    <retrievalReferenceNumber>412770451035</retrievalReferenceNumber>
    <settlementFlags>
        <ns2:settlementResponsibilityFlag>true</ns2:settlementResponsibilityFlag>
        <ns2:givPreviouslyUpdatedFlag>true</ns2:givPreviouslyUpdatedFlag>
        <ns2:givUpdatedFlag>false</ns2:givUpdatedFlag>
        <ns2:settlementServiceFlag>9</ns2:settlementServiceFlag>
    </settlementFlags>
    <purchaseIdentifier>
        <type>0</type>
        <referenceNumber>REF_123456789123456789123</referenceNumber>
    </purchaseIdentifier>
    <merchantCategoryCode>5812</merchantCategoryCode>
    <cardAcceptor>
        <name>mVisa Merchant</name>
        <terminalId>MER-ID00</terminalId>
        <idCode>MvisaMerchant-1</idCode>
        <address>
            <city>mVisa City</city>
            <country>IN</country>
        </address>
    </cardAcceptor>
    <merchantVerificationValue>0A45AF98FC</merchantVerificationValue>
</ns3:OctV2V2Response>
 
For funds transfer API creat push payment is also the same, what can i do to get the json response?
Thanks.
2 REPLIES 2
jenn_kh
Community Moderator

Re: Reqeust as json, but the api response as xml format

Thank you for your question, @SokHorng! An agent is looking for a solution for you and will get back to you soon. If any community members know a solution, please feel free to respond in this thread. -Jenn

I_Doroteo3
Visa Developer Support Specialist

Re: Reqeust as json, but the api response as xml format

Hi @SokHorng

 

Are you using Postman to call the API? Make sure that JSON is selected under the Body.

 

You can also try to change the Accept headerand set it to:

  • For JSON, choose either one of the following:
    • application/json
    • text/json

Hope this helps.

 

Thanks, 

Illana