{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"9d5845ed-8aa4-4bdf-8d77-7583d5a3acf7","name":"AliansPay API Docs","description":"[AlansPay](https://alianspay.com) is a payment methods aggregator that allows businesses and individuals to collect funds online, to accept payments from their websites or mobile app, and to send and receive money. It integrates several payment methods (Orange Money, MTN Mobile Money, Wave, VISA, Mastercard, AliansPay Wallet...) and provides you with an overview of your activites\n\n<h2>Contact</h2>\n\n<ul><li><div>Author:<a rel=\"noreferrer noopener nofollow\" href=\"https://aliansgroup.tech\" target=\"_blank\" url=\"https://aliansgroup.tech\">Alians Group LLC</a></div></li><li><div>Support: support@aliansgroup.tech</div></li><li><div>Website:<a rel=\"noreferrer noopener nofollow\" href=\"https://alianspay.com\" target=\"_blank\" url=\"https://alianspay.com\">www.alianspay.com</a></div></li><li><div>Phone: +237 656 629 522</div></li></ul>\n\n### **Supported payment methods**\n\nEach territory supports its own set of payment methods. The relevant payment method code should be the value of the moyenPayment property of a collection or disbursement request body.\n\nNote that WAVE and VISA_MASTERCARD collection operations will include a URL in the response object. That URL will need to be opened in the browser to complete the operation.\n\n|  | **Cameroon** | **Senegal** | **Togo** | **TCHAD** | **Gunée** |\n| --- | --- | --- | --- | --- | --- |\n| Payment method codes | \\- OM (Orange Money)  <br>\\- MOMO (MTN Mobile Money)  <br>\\- AP (AliansPay)  <br>\\- VISA_MASTERCARD (Visa/Mastercard) | \\- AP (AliansPay)  <br>\\- OM (Orange Money)  <br>\\- WAVE (Wave Money)  <br>\\- VISA_MASTERCARD (Visa/Mastercard) | \\- AP (AliansPay)  <br>\\- VISA_MASTERCARD (Visa/Mastercard)  <br>\\- TMoney (TOGOCOM) | \\- AP (AliansPay)  <br>\\- VISA_MASTERCARD (Visa/Mastercard)  <br>\\-MOOV Money | \\- MOMO (MTN Mobile Money)  <br>\\- AP (AliansPay) |\n| Currency code | XAF | XOF | XOF | XAF | GNF |\n\n# **All statuses**\n\nSUCCESS, SUCCESSFUL : Transaction successfully completed\n\nPENDING, UNKNOWN_STATUS : Transaction in process\n\nFAILED : Transaction failed due to unknown cause\n\nPAYEE_NOT_FOUND : The phone number being paid to is invalid.\n\nCOULD_NOT_PERFORM_TRANSACTION : This can be attributed to transaction timeout. This predominantly occurs with a delay to approve a transaction within the given time frame (10 minutes)\n\nNOT_ENOUGH_FUNDS : The payer does not have enough funds\n\nPAYER_LIMIT_REACHED : The payer's limit has been breached\n\nPAYEE_NOT_ALLOWED_TO_RECEIVE : The payee is unable to receive funds\n\nEXPIRED : The requested resource has expired\n\nCANCELED : The transaction was canceled by the initiator\n\nREJECTED : The approval was rejected\n\nERROR: Error generated during transaction execution\n\nREQUEST_REJECTED: Transaction Rejected\n\n# **OTP**\n\nIn all requests the api must send an OTP\n\nThe OTP must contain six characters and the key must be the otp-secret-code\n\nTo generate the PIN (OTP), you use the following JS libraries:\n\n### Node JS\n\n[https://www.npmjs.com/package/base32-encode](https://www.npmjs.com/package/base32-encode)\n\n[https://www.npmjs.com/package/otplib](https://www.npmjs.com/package/otplib)\n\nHere is a piece of code:\n\n``` javascript\nimport base32Encode from 'base32-encode';\nimport { authenticator } from 'otplib';\nconst secret = base32Encode(Buffer.from(guid), 'RFC4648', { padding: false });\nconst otp = authenticator.generate(secret);\n\n ```\n\n### **.Net C#**\n\n[GoogleAuthenticator](https://github.com/BrandonPotter/GoogleAuthenticator)\n\nHere is a piece of code:\n\n``` csharp\nusing Google.Authenticator;\npublic static string GetCurrentCode(string otp-secret-code)\n{\n    return new TwoFactorAuthenticator().GetCurrentPIN(otp-secret-code);\n}\n\n ```\n\n### **PHP**\n\nDownload and unzip the library: [libs.zip](https://alianspay.com/wp-content/uploads/2023/09/libs.zip)\n\nHere is a piece of code:\n\n``` php\nrequire_once __DIR__.'/libs/AliansGoogleAuthenticator.php';\n$ga = new AliansGoogleAuthenticator();\n$pin = $ga->getCode(otp-secret-code);\n\n ```\n\n### **Python**\n\npip install pyotp\n\n``` python\nimport base64\nimport pyotp\ndef generate_otp(secret_code):\n    # 1. Convert the string to bytes\n    secret_code_bytes = secret_code.encode('utf-8')\n    # 2. Encode the bytes to Base32\n    base32_secret_code_bytes = base64.b32encode(secret_code_bytes)\n    # 3. Convert the resulting bytes back into a readable string\n    base32_secret_code = base32_secret_code_bytes.decode('utf-8')\n    # 4. Initialize the TOTP validator\n    totp = pyotp.TOTP(base32_secret_code)\n    # 5. Return the current otp\n    return totp.now()\n# Input the secret key assigned to your external account\nmy_secret = \"b09f5a4c-a977-4f0d-be9d-25d42f89ec08\"\notp = generate_otp(my_secret)\n\n ```\n\n### **React Native**\n\nnpm install @multiotp/genotp\n\nnpm install hi-base32\n\n``` javascript\nvar base32 = require('hi-base32');\nconst OTP = require('@multiotp/genotp')\nconst otp = new OTP();\nconst getCodeByGUID=(guid: string)=>{\nconst code = (base32.encode(guid) as string).split('=').join('');\n return otp.generate({\n                    type: 'totp',\n                    period: 30,\n                    seedtype: 'base32',\n                    digits: 6,\n                    algorithm: 'sha1',\n                    secret: code\n                });\n}\n\n ```\n\n# **Note**\n\nFor all collection and disbursement transactions, a callback request is sent in a url string that you pass to us in the \"callbackUrl\" variable\n\nIf you do not want to receive this request do not send anything in this parameter\n\n| **Param** | **Type** | Sample response |\n| --- | --- | --- |\n| guid | string | cd8fb6d0-051d-4187-9d32-481ff4c0bfab |\n| externalTransactionId | string | MP210708723ACC512EAD3145917E |\n| status | string | SUCCESSFUL |\n| message | string | Cette opération a été effectuée avec succès ! |\n| reference | string | 237696985698 |\n| paymentMethod | string | AP |\n| description | string | Collection success |\n| transaction | string | COLLECTION |\n| partner | string | 1win |\n| amount | integer | 1500 |\n| voucherCode | string | 48/45654erds |\n| transactionSign | string | sgrstvhcqcqeehvyt jcxsererhctvjyyt |\n\n# Callback Security (transactionSign)\n\nFinally, partners must check each callback with a digital signature, called the **transactionSign**. This signature is generated as detailed below.\n\n### **Generating the transactionSign digital signature**\n\nThe `transactionSign` value is generated from four components:\n\n1. **The user login** issued by Alians to each partner. Live testing and production values of this user login are provided upon completing your integration.\n    \n2. **The transaction guid** specified by the callback resource. This results in a different `transactionSign` for each callback resource because the transaction guid changes with each callback.\n    \n3. **The transaction status** specified by the callback resource.\n    \n4. **The secret key** issued by Alians to each partner. Live testing and production values of this unique secret key are provided upon completing your integration.\n    \n\nTo generate the `transactionSign`:\n\n- Concatenate `login` , `guid` , `status` and `secretKey` into a single string.\n    \n- Hash the string using the HMAC SHA-256 algorithm.\n    \n- The output hash is the `transactionSign` that must be present in the callback response.\n    \n\nFor example, for a given callback, the `transactionSign` would be created as follows:\n\n```\nHMAC-SHA256(<userLogin> + <guid> + <status> + <secretKey>, <secretKey>)\n\n ```\n\n### **Verify the transactionSign in a callback**\n\nThe `transactionSign` value is generated as explained previously. When you receive a callback, you have to generate the digital signature on your side and compare it to the one present in the callback. If the signatures are identical, the transaction should be considered authentic; if they are ² f not, it should be ignored.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"16377844","team":2107099,"collectionId":"9d5845ed-8aa4-4bdf-8d77-7583d5a3acf7","publishedId":"UUy1dmAR","public":true,"publicUrl":"https://documenter-api.postman.tech/view/16377844/UUy1dmAR","privateUrl":"https://go.postman.co/documentation/16377844-9d5845ed-8aa4-4bdf-8d77-7583d5a3acf7","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.12.12","publishDate":"2021-09-29T09:07:35.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://postman-image-service.postman.com/api/cloudinary-proxy/postman/image/upload/t_team_logo_pubdoc/v1/team/83d2017ac8116c5baf55594800dae0c354efa847ade4c7794b553493fd90eade","favicon":"https://res.cloudinary.com/postman/image/upload/v1635345745/team/o2p67nrgekodj18xxsyt.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://documenter.gw.postman.com/view/metadata/UUy1dmAR"}