Business Data Transactions API

luke
Regular Visitor

Business Data Transactions API

Hi, I've just downloaded the sample code for the given api (Business Data Transactions API)

When I run the test in the sample I'm always getting the same error.

Are there any test data in sandbox? How can i test it?

 

This is the test:

    def testposttransaction_data(self):
        print("\nposttransaction_data")
        result = self.api.posttransaction_data(self.transformPayload('{"bank":[{"bankId":"999999"}]}'))
        print(result)
        pass

And the result:

{'transactionData': {'responseMetadata': {'requestId': 7679}, 'starterInfo': {}, 'transactionRecords': 'Improper request provided by user. Please check your request and retry.'}}

Thanks in advance

10 REPLIES 10
jvenkata
Community Moderator

Re: Business Data Transactions API

Hi luke, Did you try using the test data from the Test Data tab from your VDP dashboard ? Please try that and let me know.

 

Thanks,

Jai

luke
Regular Visitor

Re: Business Data Transactions API

Hi Jai, I'm not sure how to use it. I can't see any important tip there. 

Maybe I don't have some required access

What should I see there?

 

Take a look to it:

Screen Shot 2019-01-30 at 09.37.02.png

 

Thanks again.

jvenkata
Community Moderator

Re: Business Data Transactions API

Hi Luke, you are the right place. While constructing the request payload for the API, substitute the values for each request parameter from the Test data tab and try firing a request using that.

 

Thanks,

Jai

luke
Regular Visitor

Re: Business Data Transactions API

Hi Jai, I don't understand which values are you pointing.

Unless I'm wrong there are no values there, only a kind of summary table.

 

 

In the api reference says the only attribute I can send is a bank list.

 

I really appreciate if you could be more specific pointing how to get that valid values or saying what could be my mistake.

 

Thanks again.

 

Regards

luke
Regular Visitor

Re: Business Data Transactions API

Update:

I added metadata from data test tab. But still having same result

 

Request payload is:

{
'requestType': 'all',
'metadata': {
'startDate':'2018/06/17',
'startTime':'00:00:00',
'endDate':'2018/07/16',
'endTime':'23:59:59',
}
}

Response: 

{"transactionData": {"starterInfo": {}, "responseMetadata": {"requestId": 7784}, "transactionRecords": "Improper request provided by user. Please check your request and retry."}}

According to data test tab, I have two differents options:

- empty transaction fields (I got the answer above)

- set "acctNum,regionId,processorId,memberBankId,companyId": I don't know the right format neither valid values.

 

Screen Shot 2019-02-01 at 12.27.05.png

Thanks

jvenkata
Community Moderator

Re: Business Data Transactions API

Hi ,

 

Can you please share the below to developer@visa.com , so we can investigate further.

 

1. Endpoint

2. Request Header

3. Request body

4. Respone Header ( Include x-correlation-id)

5. Response Body

6. VDP Project Name

 

Thanks,

Jai

amgibson
Regular Visitor

Re: Business Data Transactions API

Hello, I'm also trying the Business Transaction API and have had mixed success.  If I provide the request for (https://sandbox.api.visa.com/cdsapi/commercial/v1/ob/enhanceddata) as per the example:

{"bank": [{"bankId": "999999"}]} I get a response "Improper request provided by user..." as per the previous comment.

If I add a request which matches my test data as follows :

{
    "request":{
        "metadata":{
            "startDate": "2019/05/17",
           "startTime": "00:00:00",
            "endDate": "2019/06/10",
            "endTime": "23:59:59"
        },
            "requestType":"all"
        }
}

I get a response "No records found for the given inputs. Please provide valid inputs!"

If I vary the dates to match the test data dates for 2018, I get "Historical records not supported for start date..."

If I provide a data period longer than 30 days, I get "The difference between Start Date... and end date ... is greater than 30 days"

I'm assuming that these formats are close to what is required, as there is variation in the validation returned.  But I'm in the dark in terms of an exact format/request to return the sandbox test data.  Can you tell me if this is possible ?

 

Also, adding in a transactionRecordFields element doesn't seem to make any difference, although it isn't clear to me what format this element should be in.  I have tried the following:

"transactionRecordFields": {
    "acctNum,regionId,processorId,memberBankId,companyId"
}

or should this be in the following format (in which case where do I get this information)?

"transactionRecordFields": {
    "acctNum":"<account Num>"

    "regionId": "<region Id>"

    "processorId": "<processor Id>"

    "memberBankId": "<member Bank Id>"

     "companyId": "<company Id>"
}

 

It appears that the only required input for this API is:

{
    "request":{
        "requestType":"all"
    }
}

Anything else returns:

{
    "errorMessage": null,
    "message": null,
    "msgList": ["requestType is required."],
    "status": "400:BAD_REQUEST"
}

Any help you can provide on what I'm doing wrong, or whether it is possible to return the data from the sandbox for this API, would be greatly appreciated.

 

API_Products
Visa Developer Support Specialist

Re: Business Data Transactions API

Hey @amgibson,

 

Can you please let us know if your issue is resolved? If not, I'm happy to help. 

 

 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

phedl
Regular Visitor

Re: Business Data Transactions API

Did you find out what the problem was, I'm getting the same thing and the test data screen is bloody useless...