{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"4cb94da3-17fc-4125-a339-2181bd790cce","name":"MuniciPAY M2 API - 1.2.3","description":"## **WHILE THIS API IS STILL SUPPORTED, IF YOUR ACCOUNT HAS BEEN MIGRATED TO THE NEW VERSION OF MUNICIPAY, WE RECOMMEND UPDATING YOUR REST APPLICATION TO THE FOLLOWING VERSION. PLEASE REACH OUT TO SUPPORT IF YOU NEED A SANDBOX ACCOUNT FOR TESTING:**\n\n### [https://integrations.autoagent.com](https://integrations.autoagent.com)\n\n\\--\n\nThis API exposes the MuniciPAY M2 Payment Gateway to API client applications.\n\n## Change Log\n\n| Date | Version | Description |\n| --- | --- | --- |\n| 05/11/2023 | v1.2.3 | Add _customerEmail_ to [GetPaymentResult](#getPaymentResult) |\n| 03/11/2022 | v1.2.2 | • Added new `transactionType` value of `scheduled`, and `scheduledForDate` key to [GetPaymentResult](#getPaymentResult). Also added example response to request.  <br>• Provided simplified createNewSale request. |\n| 10/12/2021 | v1.2.1 | Adjust custom fields information. |\n| 10/5/2021 | v1.2.0 | Initial public release of M2 REST API. |\n|  |  | `getPaymentResult` has been enhanced to display a `transactionType` that will indicate the current state of the transaction (sale, void, return). When state is in a void or return status, additional data will be provided in the new `adjustments` array. |\n\n## Getting Started\n\n### API User Account\n\nBefore you connect to the MuniciPAY M2 API, you will need to setup an _API user account_. To speed up the process, please have the following information ready prior to contacting our integration support specialists:\n\n| Field Name | Description |\n| --- | --- |\n| API Friendly Name | The name that should be associated with your API integration account |\n| API Username | A unique username for your API user |\n| Email | The email address that should be associated with your API integration account |\n\nOnce you have the information above prepared, please contact the MuniciPAY API team at (877) 590-5097.\n\n### Request Authentication\n\nYour MuniciPAY contact will provide you with an _API user token_ to be used for authenticating requests made to the MuniciPAY M2 API. When integrating with the API, you will need to provide your `userToken` using one of the following options.\n\n#### Custom Header\n\nSet a custom [HTTP request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header) called `userToken` in each request made to the API.\n\n#### Bearer Token\n\nSet the `Authorization` [HTTP request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header) to `Bearer` where is the value of the `userToken` provided by MuniciPAY.\n\n### JSON First\n\nAll responses from the M2 will be of type `application/json`. All data-modifying requests to the API must include the [Content-Type HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) with a value of `application/json` as well.\n\n### Response Structure\n\n#### Envelope\n\nEvery response is contained by an _envelope_, which ensures that all responses will have a predictable, minimum set of attributes regardless of the operation's error status:\n\n``` json\n{\n    \"meta\": {\n        \"success\": true,\n        \"code\": 200,\n        \"message\": \"Operation successful.\"\n    },\n    \"data\": {\n        ...\n    }\n}\n\n ```\n\n##### Meta\n\nThe _meta_ key communicates extra information about the response to the developer. At a minimum, it will always contain a _success_ flag, a _code_, and a _message_. The code almost always mirrors the HTTP response code for the operation. In the event of a failed request, any number of errors will be returned:\n\n``` json\n{\n    \"meta\": {\n        \"success\": false,\n        \"code\": 422,\n        \"message\": \"Validation failed.\",\n        \"errors\": [\n            {\n                \"message\": \"Something generally went wrong.\",\n                \"code\": 1001\n            },\n            {\n                \"message\": \"First name is required.\",\n                \"field\": \"firstName\",\n                \"code\": 1092\n            },\n            {\n                \"message\": \"Last name is required.\",\n                \"field\": \"lastName\",\n                \"code\": 1093\n            }\n        ]\n    },\n    \"data\": {\n        ...\n    }\n}\n\n ```\n\n##### Data\n\nThe _data_ key contains the entity and event data for the response (the stuff that usually matters most). It may contain any number of lists or dictionaries/maps:\n\n``` json\n{\n    \"meta\": {\n        \"success\": true,\n        \"code\": 200,\n        \"message\": \"Operation successful.\"\n    },\n    \"data\": {\n        \"firstName\": \"Test\",\n        \"lastName\": \"Person\",\n        \"amountDue\": 3.50\n    }\n}\n\n ```\n\n#### Contact Support:\n\nName : MuniciPAY API Support\n\nEmail : [support@municipay.com](https://mailto:support@municipay.com)\n\nPhone : (877) 590-5097","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"6657736","collectionId":"4cb94da3-17fc-4125-a339-2181bd790cce","publishedId":"U16qHMwA","public":true,"publicUrl":"https://integrations.municipay.com","privateUrl":"https://go.postman.co/documentation/6657736-4cb94da3-17fc-4125-a339-2181bd790cce","customColor":{"top-bar":"E1E7EA","right-sidebar":"004F7C","highlight":"004F7C"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":"API Documentation for the M2 REST Service."},{"name":"title","value":"M2 REST API"}],"appearance":{"default":"light","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"000","right-sidebar":"003366","highlight":"004F7C"}},{"name":"light","logo":null,"colors":{"top-bar":"E1E7EA","right-sidebar":"004F7C","highlight":"004F7C"}}]}},"version":"8.10.1","publishDate":"2023-05-12T03:33:10.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"M2 REST API","description":"API Documentation for the M2 REST Service."},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"M2 Demo Documentation","id":"c6a2fba4-7143-41cd-b36c-46a876afb1c5","owner":"4197993","values":[{"key":"baseUrl","value":"https://demo.municipay.com/payapp/api/v1","enabled":true},{"key":"apiUserToken","value":"pt9jbpjq5cg42ajnfpmwxtzq5cbc9mc3","enabled":true},{"key":"item1_apiId","value":"375f19f5705bbac60dfa0170bb8fb493","enabled":true},{"key":"item1_line1_apiId","value":"341","enabled":true},{"key":"item1_line2_apiId","value":"374","enabled":true},{"key":"item2_apiId","value":"375f1a65705bbac60dfa0170bb978d34","enabled":true},{"key":"item2_line1_apiId","value":"342","enabled":true},{"key":"item2_line2_apiId","value":"343","enabled":true},{"key":"callbackUri","value":"https://isv.domain.com/jsonReceiptData","enabled":true},{"key":"cancelUri","value":"https://isv.domain.com/enduserCancelPage","enabled":true},{"key":"successUri","value":"https://isv.domain.com/enduserSuccessPage","enabled":true},{"key":"cartId","value":"c094251d3e5bbac60dfa0171f57d3032","enabled":true},{"key":"paymentInfoId","value":"20129003080280064","enabled":true}],"published":true}],"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/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":"https://municipay.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"},{"label":"M2 Demo Documentation","value":"4197993-c6a2fba4-7143-41cd-b36c-46a876afb1c5"}],"canonicalUrl":"https://integrations.municipay.com/view/metadata/U16qHMwA"}