{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"ec6b1a2c-6fe9-43e1-ae9a-da628709f6c8","name":"RapydGateway Examples","description":"Here you can find example requests, flow diagrams and short explanations on all ValitorPay payment operations.\n\nClick the **\"Run in Postman\"** button in the top right corner of this page to run the examples in your browser, or in the Postman desktop app. You can also modify request values to fit your needs and test them out before you start to code.\n\nYou can switch between the example languages (C#, cURL, Java etc.) at the top of this page using the **\"Language\"** menu.\n\n## Authorization\n\nAn API Key is used for authorization. Depending on setup of a key, different parameters in request can be optional, required or not allowed. Therefore three different API Keys are provided with each testcase. Please choose the key that corresponds to your use case.\n\nThe types provided and their key differences are:\n\n- Merchant\n    - is not allowed to include agreementNumber in requests\n    - is not allowed to include terminalId in requests\n\n| AgreementNumber | TerminalID | Currency | APIKey |\n| --- | --- | --- | --- |\n| 984000 | 90000001 | USD | APIKey DemoUSD.6wNfb4JzosUjXBVrkN72nN2ULXb2/JIGxwmUPtbFBDA= |\n| 912400 | 90000003 | CAD | APIKey DemoCAD.ZCV1gKbtDAbsqEEpTWZzxUXlN2tayl8NLb5RypxS22U= |\n| 231517 | 14041001 | ISK | APIKey DemoISK.drEAvYq8xWYtqYtsgXXM76Atlq4NaJH+iqZ9CEE30T8= |\n| 982601 | 90000001 | GBP | APIKey DemoGBP.xQaI8RVpAfoN9hNb8VGMBkbdRzA3VBLRh/eeOf7dyxw= |\n| 997801 | 90000001 | EUR | APIKey DemoEUR.djZGmtMxLI73Kvb1gdhL7rbk6DnBQ4YSnt19UVSRCxw= |\n\n- Payment Facilitator\n    - APIKey DemoPF.POED43XUAykXKlHG3GOmdOBSyfb4uuSx2Ft24Kl7uxU=\n    - has multiple submerchants\n    - must include agreementNumber in every request\n    - must include terminalId in every request\n    - must include sponsoredMerchantData object where available\n- Merchant - Multi\n    - APIKey DemoMulti.GJjOqQ3I4PDhIMHyCz6a/5QEcwdF4X3bgJqlBfdCuXM=\n    - single merchant with multiple agreements\n    - must include agreementNumber in every request\n    - must include terminalNumber in every request\n\n## HTTP Status codes\n\nValitorPay makes use of HTTP status codes sent by the server in response to the client request. See the **“Response samples”** section in the ValitorPay live specification [https://uat.valitorpay.com](https://uat.valitorpay.com/index.html#operation/VirtualCardPayment)\n\n#### 400 Bad Request\n\nValitor Pay will respond with a Bad Request HTTP status response code if the client request breaks the primary rules of the operation in ValitorPay. These rules are defined by Valitor and contain a logic that will help steer the merchant toward a correctly made request.\n\nIt is **very important** that merchants know how to parse these response and react to them.\n\n400 BadRequest message is in a different format from 200 OK message, since it has not gone far enough in the entire pipeline to be able to build a full 200 response.\n\nWhen request is rejected with a 400 BadRequest then it has conflicting information based on our rules, insufficient information in some fields or corrupt json.\n\nExample\n\n{  \n\"title\": \"One or more validation errors occurred.\",  \n\"errors\": {  \n\"CardNumber\": \\[  \n\"'Card Number' must not be empty.\"  \n\\]  \n},  \n\"correlationID\": \"549730b6-6d6b-4f2d-a020-a28e0ce95e82\"  \n}\n\n#### 401 Unauthorized\n\nWhen ApiKey is not valid, ValitorPay will response with the HTTP status code 401 Unauthorized.\n\nNo body is returned with this status code. Only the status code.\n\nNote : This often occurs because users forget to put the phrase \"APIiKey\" in front of their actual apiKey value, seperated by a single space.\n\nExample : APIKey MyApiKey123ABC\n\n#### **200 OK**\n\nWhen client request is valid, based on our rules, it will be allowed entry into ValitorPay which will process the request.\n\n200 ok will happen regardless if the request was unsuccessful in obtaining a positive result, for example if a payment is rejected by the card issuer because of insufficient funds. It is still a valid request by ValitorPay standards, even though the card issuer is not accepting it.\n\nThe IsSuccess parameter in the 200 OK response body is the primary indicator that the request was successful in obtaining a desired result.\n\nExample where request obtained successful response.\n\n{  \n\"acquirerReferenceNumber\": \"784281\",  \n\"transactionID\": \"205309784281\",  \n\"authorizationCode\": \"878346\",  \n\"transactionLifecycleId\": \"ABC6697400222\"\",  \n\"maskedCardNumber\": \"222300**1873\",  \n\"isSuccess\": true,  \n\"cardInformation\": {  \n\"cardScheme\": \"M\",  \n\"issuingCountry\": \"US\",  \n\"cardUsage\": \"Debit\",  \n\"cardCategory\": \"Consumer\",  \n\"outOfScaScope\": true  \n},  \n\"responseCode\": \"00-I\",  \n\"responseDescription\": \"Authorized\",  \n\"responseTime\": \"00:00:00\",  \n\"correlationID\": \"e205d364-d0a7-4cfb-8be1-cf104ca9d00a\"  \n}\n\nExample where request was unsuccessful\n\n{  \n\"acquirerReferenceNumber\": \"430179\",  \n\"maskedCardNumber\": \"222300**1873\",  \n\"isSuccess\": false,  \n\"cardInformation\": {  \n\"cardScheme\": \"M\",  \n\"issuingCountry\": \"US\",  \n\"cardUsage\": \"Debit\",  \n\"cardCategory\": \"Consumer\",  \n\"outOfScaScope\": true  \n},  \n\"responseCode\": \"AF-A\",  \n\"responseDescription\": \"Invalid CardVD Correlation ID: 65885fb2-21db-48c6-9c7e-1f3bc779ad14\",  \n\"responseTime\": \"00:00:00\",  \n\"correlationID\": \"65885fb2-21db-48c6-9c7e-1f3bc779ad14\"  \n}\n\n## 5xx HTTP Status response codes\n\nIn the rare case of a 5xx response code there is something wrong with ValitorPay setup. It might be unable to access the internal services it relies on, there might be a network problem in accessing ValitorPay, there might be a logic error in the ValitorPay application or some other issues resulting is the server to respond with a 5xx code.\n\nIt is important that you reach out to your Valitor implementation manager as soon as possible if you run into an 5xx status code. This way we will be able to take corrective measures quickly and prevent any loss of business.\n\n####","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"34166005","team":58488,"collectionId":"ec6b1a2c-6fe9-43e1-ae9a-da628709f6c8","publishedId":"2sA3BuWp7y","public":true,"publicUrl":"https://implementation.uat.valitorpay.com","privateUrl":"https://go.postman.co/documentation/34166005-ec6b1a2c-6fe9-43e1-ae9a-da628709f6c8","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.10.1","publishDate":"2024-04-29T08:55:13.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/6f401621aee693028269b7a993610f675b57edb261c273fc62325e0b3b0b41bd","favicon":"https://valitorpay.com/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://implementation.uat.valitorpay.com/view/metadata/2sA3BuWp7y"}