Visa Developer Community

Regular Visitor

Two-Way SSL with curl

I wanted to share with the community how to use curl for testing VISA API

 

You will need your private key from when you created your project, the certificate, username, and password. Plugin the values where appropriate before executing the curl command. The example illustrated below tests the exchange rates API

 

curl -E cert.pem --key myProject.pem -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic $(echo -n username:password | base64 -w 0)" -d '{"destinationCurrencyCode": "840","sourceAmount": "1","sourceCurrencyCode": "643"}' -X POST https://sandbox.api.visa.com/forexrates/v1/foreignexchangerates

 

Best regards

2 REPLIES 2
Highlighted
Visa Dev Moderator

Re: Two-Way SSL with curl

Hey @jbills,

 

Thanks for sharing this with the Visa Developer community. We look forward to seeing more helpful posts from you.

 



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

Thanks,
Diana

Highlighted
Community Manager

Re: Two-Way SSL with curl

Thanks for sharing @jbills




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