Payments
...
Foreign exchange APIs
Exchange rates
1 min
use cross rivers foreign exchange (fx) rates api to get a foreign currency conversion rate from the card network { "name" "endpoint /api/fxrates", "method" "post", "url" "https //pushtopaystaging crbnj net/api/fxrates", "description" "returns up to date foreign exchange rate information for card based payments as a cross river merchant partner, you do this before making an international transaction ", "tab" "examples", "examples" { "languages" \[ { "id" "6jiq6rdv2xmc s8i1yvv1", "language" "curl", "code" "curl location 'https //pushtopaystaging crbnj net/api/fxrates' \\\\\n header 'content type application/json' \\\\\n header 'authorization ••••••' \\\\\n data '{\n \\"requestid\\" \\"26a6448a 3b4e 48c3 84b0 d63d520c8983\\",\n \\"sourcecurrency\\" \\"840\\",\n \\"sourceamount\\" 10000,\n \\"destinationcurrency\\" \\"124\\",\n \\"markuppercentage\\" \\"5\\"\n}'", "customlabel" "" }, { "id" "qyscrubrbv7 9lawjxnc9", "language" "nodejs", "code" "var https = require('follow redirects') https;\nvar fs = require('fs');\n\nvar options = {\n 'method' 'post',\n 'hostname' 'pushtopaystaging crbnj net',\n 'path' '/api/fxrates',\n 'headers' {\n '' '',\n 'content type' 'application/json',\n 'authorization' 'bearer eyjhbgcioijsuzi1niisimtpzci6ijdpsgdmzmezcnbpns1grxpsyk0zodzfrlk5cyising1dci6ijdpsgdmzmezcnbpns1grxpsyk0zodzfrlk5cyisinr5cci6ikpxvcj9 eyjpc3mioijodhrwczovl29hdxrodgvzdc5jcmjuai5uzxqilcjuymyioje3ntq5otg4ndqsimlhdci6mtc1ndk5odg0ncwizxhwijoxnzu1mdayndq0lcjhdwqiolsiy3jiyxbpiiwiahr0chm6ly9vyxv0ahrlc3quy3jibmoubmv0l3jlc291cmnlcyjdlcjzy29wzsi6wyjjcmjhcgkixswiy2xpzw50x2lkijoiufrqrvjouk1tdgddbgllbnqilcjyb2xlijoic2vjuhrwzufwavn0z0v4dcisimp0asi6ija4rtmym0u4qja3mdixodawodqxrkzgnjawqundrjkyin0 vs6ob8b7mquxddor8ng78toovddy7kjn1s8jwywabef67xbsazdlpyvpqmlhx1cxh3nytapyfgknxenwvffiqmbbi1haywrwyfj gkq8k5dcdxkg5xbmmmllfs8oosimezmwmfl ivgofjbmuvyjoswdurwk6wpjekydey2qagio1 pbdd2jbtabpjs4reznfs 7ngago7uo5u6guxo4q4bvrlqztew8cbxgxpgnp8izwo56jzq7yriyvg defp6nqclbd0hvfk1m8p0kz4r vml3vnq kz13xqy62o qxadzzhm8zpv c6kpwyxtwo6xqrlzdxkcsbohzwnoiuw'\n },\n 'maxredirects' 20\n};\n\nvar req = https request(options, function (res) {\n var chunks = \[];\n\n res on(\\"data\\", function (chunk) {\n chunks push(chunk);\n });\n\n res on(\\"end\\", function (chunk) {\n var body = buffer concat(chunks);\n console log(body tostring());\n });\n\n res on(\\"error\\", function (error) {\n console error(error);\n });\n});\n\nvar postdata = json stringify({\n \\"requestid\\" \\"335facfd 896f 4872 9cc3 ab5aea22a162\\",\n \\"sourcecurrency\\" \\"840\\",\n \\"sourceamount\\" 10000,\n \\"destinationcurrency\\" \\"124\\",\n \\"markuppercentage\\" \\"5\\"\n});\n\nreq write(postdata);\n\nreq end();", "customlabel" "" }, { "id" "wgesnktmlg438mmxsur5j", "language" "python", "code" "import requests\nimport json\n\nurl = \\"https //pushtopaystaging crbnj net/api/fxrates\\"\n\npayload = json dumps({\n \\"requestid\\" \\"2379bf4b 767b 47f5 8dac 5b0d4d85130e\\",\n \\"sourcecurrency\\" \\"840\\",\n \\"sourceamount\\" 10000,\n \\"destinationcurrency\\" \\"124\\",\n \\"markuppercentage\\" \\"5\\"\n})\nheaders = {\n '' '',\n 'content type' 'application/json',\n 'authorization' 'bearer eyjhbgcioijsuzi1niisimtpzci6ijdpsgdmzmezcnbpns1grxpsyk0zodzfrlk5cyising1dci6ijdpsgdmzmezcnbpns1grxpsyk0zodzfrlk5cyisinr5cci6ikpxvcj9 eyjpc3mioijodhrwczovl29hdxrodgvzdc5jcmjuai5uzxqilcjuymyioje3ntq5otg4ndqsimlhdci6mtc1ndk5odg0ncwizxhwijoxnzu1mdayndq0lcjhdwqiolsiy3jiyxbpiiwiahr0chm6ly9vyxv0ahrlc3quy3jibmoubmv0l3jlc291cmnlcyjdlcjzy29wzsi6wyjjcmjhcgkixswiy2xpzw50x2lkijoiufrqrvjouk1tdgddbgllbnqilcjyb2xlijoic2vjuhrwzufwavn0z0v4dcisimp0asi6ija4rtmym0u4qja3mdixodawodqxrkzgnjawqundrjkyin0 vs6ob8b7mquxddor8ng78toovddy7kjn1s8jwywabef67xbsazdlpyvpqmlhx1cxh3nytapyfgknxenwvffiqmbbi1haywrwyfj gkq8k5dcdxkg5xbmmmllfs8oosimezmwmfl ivgofjbmuvyjoswdurwk6wpjekydey2qagio1 pbdd2jbtabpjs4reznfs 7ngago7uo5u6guxo4q4bvrlqztew8cbxgxpgnp8izwo56jzq7yriyvg defp6nqclbd0hvfk1m8p0kz4r vml3vnq kz13xqy62o qxadzzhm8zpv c6kpwyxtwo6xqrlzdxkcsbohzwnoiuw'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "customlabel" "" }, { "id" "da t cvjtlbszp 5123gq", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"json\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //pushtopaystaging crbnj net/api/fxrates\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"\\"] = \\"\\"\nrequest\[\\"content type\\"] = \\"application/json\\"\nrequest\[\\"authorization\\"] = \\"bearer eyjhbgcioijsuzi1niisimtpzci6ijdpsgdmzmezcnbpns1grxpsyk0zodzfrlk5cyising1dci6ijdpsgdmzmezcnbpns1grxpsyk0zodzfrlk5cyisinr5cci6ikpxvcj9 eyjpc3mioijodhrwczovl29hdxrodgvzdc5jcmjuai5uzxqilcjuymyioje3ntq5otg4ndqsimlhdci6mtc1ndk5odg0ncwizxhwijoxnzu1mdayndq0lcjhdwqiolsiy3jiyxbpiiwiahr0chm6ly9vyxv0ahrlc3quy3jibmoubmv0l3jlc291cmnlcyjdlcjzy29wzsi6wyjjcmjhcgkixswiy2xpzw50x2lkijoiufrqrvjouk1tdgddbgllbnqilcjyb2xlijoic2vjuhrwzufwavn0z0v4dcisimp0asi6ija4rtmym0u4qja3mdixodawodqxrkzgnjawqundrjkyin0 vs6ob8b7mquxddor8ng78toovddy7kjn1s8jwywabef67xbsazdlpyvpqmlhx1cxh3nytapyfgknxenwvffiqmbbi1haywrwyfj gkq8k5dcdxkg5xbmmmllfs8oosimezmwmfl ivgofjbmuvyjoswdurwk6wpjekydey2qagio1 pbdd2jbtabpjs4reznfs 7ngago7uo5u6guxo4q4bvrlqztew8cbxgxpgnp8izwo56jzq7yriyvg defp6nqclbd0hvfk1m8p0kz4r vml3vnq kz13xqy62o qxadzzhm8zpv c6kpwyxtwo6xqrlzdxkcsbohzwnoiuw\\"\nrequest body = json dump({\n \\"requestid\\" \\"7c071bb9 28c2 40a6 a910 d83b77bf9f50\\",\n \\"sourcecurrency\\" \\"840\\",\n \\"sourceamount\\" 10000,\n \\"destinationcurrency\\" \\"124\\",\n \\"markuppercentage\\" \\"5\\"\n})\n\nresponse = https request(request)\nputs response read body\n", "customlabel" "" }, { "id" "rovhez61xc4t y3rpv0rj", "language" "go", "code" "package main\n\nimport (\n \\"fmt\\"\n \\"strings\\"\n \\"net/http\"\n \\"io\\"\n)\n\nfunc main() {\n\n url = \\"https //pushtopaystaging crbnj net/api/fxrates\\"\n method = \\"post\\"\n\n payload = strings newreader(`{`+\\"\n\\"+`\n \\"requestid\\" \\"8f0da9e3 8cb4 48f8 9805 614013445353\\",`+\\"\n\\"+`\n \\"sourcecurrency\\" \\"840\\",`+\\"\n\\"+`\n \\"sourceamount\\" 10000,`+\\"\n\\"+`\n \\"destinationcurrency\\" \\"124\\",`+\\"\n\\"+`\n \\"markuppercentage\\" \\"5\\"`+\\"\n\\"+`\n}`)\n\n client = \&http client {\n }\n req, err = http newrequest(method, url, payload)\n\n if err != nil {\n fmt println(err)\n return\n }\n req header add(\\"\\", \\"\\")\n req header add(\\"content type\\", \\"application/json\\")\n req header add(\\"authorization\\", \\"bearer eyjhbgcioijsuzi1niisimtpzci6ijdpsgdmzmezcnbpns1grxpsyk0zodzfrlk5cyising1dci6ijdpsgdmzmezcnbpns1grxpsyk0zodzfrlk5cyisinr5cci6ikpxvcj9 eyjpc3mioijodhrwczovl29hdxrodgvzdc5jcmjuai5uzxqilcjuymyioje3ntq5otg4ndqsimlhdci6mtc1ndk5odg0ncwizxhwijoxnzu1mdayndq0lcjhdwqiolsiy3jiyxbpiiwiahr0chm6ly9vyxv0ahrlc3quy3jibmoubmv0l3jlc291cmnlcyjdlcjzy29wzsi6wyjjcmjhcgkixswiy2xpzw50x2lkijoiufrqrvjouk1tdgddbgllbnqilcjyb2xlijoic2vjuhrwzufwavn0z0v4dcisimp0asi6ija4rtmym0u4qja3mdixodawodqxrkzgnjawqundrjkyin0 vs6ob8b7mquxddor8ng78toovddy7kjn1s8jwywabef67xbsazdlpyvpqmlhx1cxh3nytapyfgknxenwvffiqmbbi1haywrwyfj gkq8k5dcdxkg5xbmmmllfs8oosimezmwmfl ivgofjbmuvyjoswdurwk6wpjekydey2qagio1 pbdd2jbtabpjs4reznfs 7ngago7uo5u6guxo4q4bvrlqztew8cbxgxpgnp8izwo56jzq7yriyvg defp6nqclbd0hvfk1m8p0kz4r vml3vnq kz13xqy62o qxadzzhm8zpv c6kpwyxtwo6xqrlzdxkcsbohzwnoiuw\\")\n\n res, err = client do(req)\n if err != nil {\n fmt println(err)\n return\n }\n defer res body close()\n\n body, err = io readall(res body)\n if err != nil {\n fmt println(err)\n return\n }\n fmt println(string(body))\n}", "customlabel" "" } ], "selectedlanguageid" "6jiq6rdv2xmc s8i1yvv1" }, "results" { "languages" \[ { "id" "gfjldn3nn0ckqmabxprw4", "language" "200", "customlabel" "", "code" "{\n \\"version\\" \\"1 0 0 0\\",\n \\"result\\" {\n \\"requestid\\" \\"6b629174 3322 42e2 821c 72569ba73f27\\",\n \\"fxratenetworkresponses\\" \[\n {\n \\"network\\" \\"mastercard\\",\n \\"conversionrate\\" 1 3243249,\n \\"destinationamountwithmarkup\\" 13243 24,\n \\"destinationamountwithoutmarkup\\" 13243 24\n },\n {\n \\"network\\" \\"visa\\",\n \\"conversionrate\\" 1 3176,\n \\"destinationamountwithmarkup\\" 13176 0,\n \\"destinationamountwithoutmarkup\\" 13176 0\n }\n ]\n },\n \\"issuccessfull\\" true,\n \\"issuccessful\\" true\n}" }, { "id" "nb63syywtuc7zcqhfggye", "language" "400", "code" "{\n \\"version\\" \\"1 0 0 0\\",\n \\"result\\" {\n \\"errors\\" \[\n {\n \\"code\\" 2000,\n \\"message\\" \\"request 3fa85f64 5717 4562 b3fc 2c963f66afa6 fxrates request failed \\"\n }\n ]\n },\n \\"issuccessfull\\" false,\n \\"issuccessful\\" false\n}", "customlabel" "" } ], "selectedlanguageid" "nb63syywtuc7zcqhfggye" }, "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[ { "name" "requestid", "kind" "optional", "type" "string", "description" "the guid that enables the application to link request with response", "" "optional" }, { "name" "sourcecurrency", "kind" "optional", "type" "string", "description" "the currency code for the source (monetary) amount this is a numeric value based on the currencies listed in iso 4217 for example, if converting from (usd) 840 to (cad) 124, the value would be 840 ", "" "the currency code for the source (monetary) amount this is a numeric value based on the currencies listed in iso 4217 for example, if converting from (usd) 840 to (cad) 124, the value would be 840 " }, { "name" "sourceamount", "kind" "optional", "type" "number", "description" "the amount of money the payer is sending, in the currency indicated in sourcecurrency \nthis value is needed for source to destination lookup \n\nminor currency units after the decimal point must be ≤ (less than or equal to) the defined currency exponent (the digits following the decimal) \n\nthis field cannot be 0 or null \n\nthe field contains between 1 – 13 characters, including a decimal, for example, 100 55 \n\nfor example \ntwo (2) digits indicated after the decimal point for a two exponent currency (99 85, 99 00, etc ) \n\nthree (3) digits indicated after the decimal point for a three exponent currency (989 333, 989 340, 989 000, etc ) \n\nno decimal point or minor units indicated for a zero (0) exponent currency (95, 100, etc ) ", "" "the amount of money the payer is sending, in the currency indicated in sourcecurrency \nthis value is needed for source to destination lookup \n\nminor currency units after the decimal point must be ≤ (less than or equal to) the defined currency exponent (the digits following the decimal) \n\nthis field cannot be 0 or null \n\nthe field contains between 1 – 13 characters, including a decimal, for example, 100 55 \n\nfor example \ntwo (2) digits indicated after the decimal point for a two exponent currency (99 85, 99 00, etc ) \n\nthree (3) digits indicated after the decimal point for a three exponent currency (989 333, 989 340, 989 000, etc ) \n\nno decimal point or minor units indicated for a zero (0) exponent currency (95, 100, etc ) " }, { "name" "destinationcurrency", "kind" "optional", "type" "string", "description" "the currency code for the destination (monetary) amount a numeric value based on the currencies listed in iso 4217 for example, if converting from (usd) 840 to (cad) 124, the value would be 124 ", "" "the currency code for the destination (monetary) amount a numeric value based on the currencies listed in iso 4217 for example, if converting from (usd) 840 to (cad) 124, the value would be 124 " } ], "formdataparameters" \[] }, "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" }, "response" \[ { "name" "requestid", "kind" "optional", "type" "string", "description" "the guid that enables the application to link request with response" }, { "name" "fxratenetworkresponses", "kind" "optional", "type" "object", "description" "a list of conversion rates per each relevant card network", "children" \[ { "name" "network", "kind" "optional", "type" "string", "description" "the card payments network, either visa or mastercard " }, { "name" "conversionrate", "kind" "optional", "type" "number", "description" "the currency conversion rate, for example, 1 25342 note that this value does not include markup " }, { "name" "destinationamountwithoutmarkup", "kind" "optional", "type" "number", "description" "the amount of the source transaction does not include markup in the source currency for example, 100 55 the api returns this field in a source to destination inquiry response this verifies the originator and recipient of funds " }, { "name" "destinationamountwithmarkup", "kind" "optional", "type" "number", "description" "the amount of the source transaction includes markup in the destination currency for example, 100 55 when markup applies, the api returns this field in a source to destination inquiry response " } ] } ] }