{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"02a102fb-1d38-45ca-8304-84ed9d697840","name":"API 1.17","description":"This is the documentation for the SparkMeter API. The SparkMeter API enables retrieving customer and transaction information, remote payment and reversal, ands SMS communication.\n\n<h2>Authentication</h2>\n\nAll API requests are authenticated using the `Authentication-Token` header. In the code samples, replace `authentication_token` with the token you obtain via the instructions below.\n\n<h3>Obtaining a Token</h3>\n\nIn your ThunderCloud or GroundBolt, navigate to an API user's information page. In the \"Information\" box, click \"View Credentials\" under API Credentials. In the popup window appearing, you will find an authentication token under \"API token\". Copy it and give it to the trusted person/service who will be consuming the API. This token gives access to every API Call, including creating transactions using this API user's account. Tokens are reset by clicking \"Reset Credentials\" under \"View Credentials\" inside the API user's information page.\n\nYou need to be signed in with Operator privileges to obtain a token on an API user's account.\n\n<h3>Missing or Invalid Token</h3>\n\n* Response 401 (application/json)\n* Returned if the authentication token is missing or invalid, the following response will be provided:\n* Body:\n\t```json\n{\n\t\"error\": \"unauthorized\",\n\t\"status\": \"failure\"\n}\n```\n\n\n<h2>Encoding</h2>\n\nAll API requests and responses are encoded with UTF-8, which is required by the JSON standard. Consumers of the API need to convert between UTF-8 and their desired encoding.\n\n<h2>Endpoint</h2> \n\nFrom the same popup window used to obtain an authentication token, retrieve the \"API endpoint.\" This API endpoint will be the same URL you use to access the ThunderCloud system at the URI \"/api/v0/\"\n\n<h3>Invalid Endpoint</h3>\n\n* Response 404 (application/json)\n* Returned if an invalid endpoint was provided.\n* Body:\n\t```json\n{\n\t\"error\": \"no such api\",\n\t\"status\": \"failure\"\n}\n```\n\n\n<h2>POST Parameters</h2>\n\nSparkMeter uses the `POST` method for requests that need to either submit new data or modify existing data. There are two different ways of providing the POST APIs with data.\n\nYou can pass in parameters either by using `application/x-www-form-urlencoded` or `application/json`.\n\n<h3>Form</h3>\n\n`application/x-www-form-urlencoded` is the standard way a web browser submits forms. Most HTTP libraries will default to this method. \n\nParameters are passed in like this:\n\n`param1=value1&param2=value2`\n\n<h3>JSON</h3>\n\n`application/json` is similar, but uses JSON encoding instead. \n\nSame example as above:\n\n`{\"param1\":\"value1\",\"param2\":\"value2\"}`\n\nIf you are unsure how to pass parameters, use `application/x-www-form-urlencoded`.\n\n<h3>Unsupported Mimetype</h3>\n\n* Response 415 (application/json)\n* Returned if the request uses an unsupported mime type.\n* Body:\n\t```json\n{\n\t\"error\": \"bad mimetype, must be application/x-www-form-urlencoded or application/json\",\n\t\"status\": \"failure\"\n}\n```\n\t\n<h3>Method Not Allowed</h3>\n\n* Response `405 Method Not Allowed`\n* Returned if the wrong HTTP method is used (e.g., `GET` or `POST`)\n* Body:\n\t```html\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"> \n<title>405 Method Not Allowed</title> \n<h1>Method Not Allowed</h1> \n<p>The method is not allowed for the requested URL.</p>\n```\n\nIf you encounter this error, try following these steps to troubleshoot:\n\n1. Ensure the documentation indicates that the endpoint supports the method being used.\n2. Verify that the path matches what's documented - that is, if there is a trailing slash in the documentation, try adding it to the query.\n3. If querying the ThunderCloud API, please verify that the URL is using `https` and not `http`.\n\n<h2>Description of a typical use case for mobile money</h2>\n\n<h3>Requirements</h3>\n\nIn order to enter a mobile transaction in the SparkMeter system, you need:\n\n* a valid API token (see above for instructions on how to obtain a token)\n* the code of the customer concerned by the transaction. This code is defined by the system owner and should be unique. It can be found and defined on the customer page.\n* optionally, an external id for the transaction to be placed in the system. This id is defined and provided by the API consumer, and must be unique.\n\nThe transaction will be placed from the account of the vendor matching the token used, to the customer matching the code provided.\n\n<h3>Step-by-Step</h3>\n\n1. **Get Customer Info** using the customer code.\n\n Upon success of the call, obtain value of field `id` to get the customer's internal id.\n\n2. **Create Transaction**, using the customer's internal id just obtained.\n Optionally, an `external_id` can be provided for the transaction. The system will reject the transaction if a transaction already exists with this `external_id`. \n \nUpon success, the call returns an internal id for the transaction just created. \n\nThat's it! With SparkMeter's SMS Alert, an SMS can be automatically sent to the customer once the transaction has been validated. If you wish to follow the status of a transaction, you can follow these optional steps:\n\n1. [optional] **Wait for the transaction to be processed.**\n\n Typically, it takes a few minutes for the transaction to be sent to the Meter Application Server and processed there, then synced back.\n\n2. [optional] **Get Transaction** using the internal id obtained from **Create Transaction** or the external id provided to it.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"5527202","collectionId":"02a102fb-1d38-45ca-8304-84ed9d697840","publishedId":"T1LPBks5","public":true,"publicUrl":"https://api.sparkmeter.io","privateUrl":"https://go.postman.co/documentation/5527202-02a102fb-1d38-45ca-8304-84ed9d697840","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2020-09-04T10:56:41.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"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/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":"https://sparkmeter.io/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://api.sparkmeter.io/view/metadata/T1LPBks5"}