{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"5956427c-08d1-42ba-8faf-e11527a5680e","name":"Mobile Crediting API Docs","description":"This API is used by specifically authorised and trusted 3rd parties to perform crediting to a mobile phone account.\n\nOur API aims to be simple and predictable. All requests are made via **POST** and accept a [JSON encoded](http://www.json.org/) body and return JSON encoded responses.\n\nYou can use the API in test mode by using the sandbox url: https://credit.sandbox.sling.io/api/v1 you will have been provided with a separate API key for the sandbox environment.\n\n# Getting Started\nOur APIs are designed to provide simple ways to perform tasks with a mobile phone account. This documentation covers the crediting API specifically. We have provided a sandbox environment where you may safely perform actions without incurring costs.\n\n| Environment | URL                                    |\n|-------------|----------------------------------------|\n| Sandbox     | https://credit.sandbox.sling.io/api/v1 |\n| Production  | https://credit.sling.io/api/v1         |\n\nIntegrating our credit api in your application is easy with the following steps:\n\n1. **Obtain API keys** Your contact at Sling.io will provide you with a sandbox key for you to develop and test your application.\n1. **Set up your webhook endpoint** Once you have told us the endpoint the use for credit request endpoints, we will begin sending reports for your credit requests.\n1. **Make a test request** We suggest performing an eligibility check initially to check your authentication strategy is correct. Requests to credit an account within the sandbox environment will be inert and will not credit a phone.\n\n# Authentication\nAll calls to the API require authentication with an acceptable API key as an `Authorization` header parameter. Additionally, all calls must be made over HTTPS. Using plain HTTP will fail.\n\nThe api key will be used to sign webhook requests and the signature will be provided in the `X-SIGNATURE` header for verification.\n\nKeys are revokable and revoked keys will be valid for a period of time to allow for transitioning in client applications. Speak to your representative to request key revocation. See `Signing of Requests` section for how to process signatures.\n\n# Versioning\nWe aim to keep our API changes as backwards-compatible as possible. When this is not possible, we will increment the major version and the associated path component of the URI (e.g. /v1/endpoint will become /v2/endpoint). The exact version is provided in the `X-VERSION` header of all responses.\n\nWebhook callback requests have the version present in the JSON data.\n\nYou will be informed of any deprecations and data changes in our API.\n\n# Idempotency\nThe API supports idempotency, allowing you to safely retry requests without fear of accidentally performing the same operation twice. The idempotency is facilitated by the `request_id` parameter of your request for any operation that affects a user's account.\n\n# Workflow\nIn order to perform a credit against an account, we will always perform an eligibility check with our upstream carriers. If your system requires an eligibility check at any other time, we have provided an eligibility endpoint.\n\n![test](https://s3-eu-west-1.amazonaws.com/cdn.pmcservices.co.uk/platform/credit_api.png)\n\n## Retries\nAny technical failure codes from the carrier such as service unavailable will be retried over a period of 60 seconds (as the default). Once the event is expired a webhook will be dispatched with the error code `TIMEOUT_EXCEEDED_ERROR` if you wish to test this case then please see the example MSISDN below.\n\n# Test MSISDNs\nIn order to help client development, we have configured the sandbox environment to respond with particular results in the webhook request based on the MSISDN provided.\n\nResponse outcomes will be set accordingly:\n\n| MSISDN       | Carrier | Status    | Error Code             |\n|--------------|---------|-----------|------------------------|\n| 447010000001 | EE      | succeeded |                        |\n| 447010000002 | EE      | failed    | CARRIER_ERROR          |\n| 447010000003 | EE      | failed    | SYSTEM_ERROR           |\n| 447010000004 | EE      | failed    | TIMEOUT_EXCEEDED_ERROR |\n\n## Ineligible test msisdns\n| MSISDN       | Carrier | Eligibility | \n|--------------|---------|-------------|\n| 44702xxxxxxx | O2      | false       |\n| 44703xxxxxxx | Vodafone| false       |\n| 44704xxxxxxx | Three   | false       |\n","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"11921","team":155267,"collectionId":"5956427c-08d1-42ba-8faf-e11527a5680e","publishedId":"SzzgBzkG","public":true,"publicUrl":"https://docs.credit.sling.io","privateUrl":"https://go.postman.co/documentation/11921-5956427c-08d1-42ba-8faf-e11527a5680e","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"3297F5"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.0","publishDate":"2020-09-07T10:09:48.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Documentation","id":"4b16348b-e709-4ffa-8aca-18b8590ed947","owner":"11921","values":[{"key":"webhookUrl","value":"your_api_url","enabled":true},{"key":"creditsAuthToken","value":"your_api_key","enabled":true},{"key":"exampleUrl","value":"https://credit.sandbox.sling.io","enabled":true},{"key":"creditIUrl","value":"https://credit.sandbox.sling.io","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/30530475c770756a0556de70c19b121e003264e48bff8d1227066663398e5136","favicon":"https://sling.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"},{"label":"Documentation","value":"11921-4b16348b-e709-4ffa-8aca-18b8590ed947"}],"canonicalUrl":"https://docs.credit.sling.io/view/metadata/SzzgBzkG"}