{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"14c7081d-4676-403a-aa0b-2a5e8b667f43","name":"MinatoPay.com API Documentation","description":"[MinatoPay.com](https://minatopay.com/) provides a powerful and easy-to-use REST API that allows you to accept Bitcoin payments on the lightning network.\n\n# Quickstart\n\nYou can get started by getting your API keys at [app.minatopay.com/api-keys](https://app.minatopay.com/api-keys)\n\n<img src=\"https://content.pstmn.io/ed43683e-cdb7-4173-9c3f-77ad777b4ee1/bWluYXRvX2FwaV9rZXlzLnBuZw==\" width=\"1000\" height=\"379\">\n\nAfter Creating your API key, you should see something like this:\n\n<img src=\"https://content.pstmn.io/5457fccc-a8ba-4417-8e26-8c86e3acab31/bWluYXRvX2FwaV9rZXlzMy5wbmc=\" width=\"1000\" height=\"459\">\n\n# Authorization\n\nTo authorize your requests, you must pass the API key in the `Authorization` header with the following format:\n\n```\nAuthorization: Api-Key {api_key}\n\n```\n\nIn Postman, your `Authorization` settings should look like this:\n\n<img src=\"https://content.pstmn.io/bf8a0960-0169-4baa-9626-a195f0afd028/bWluYXRvX2FwaV9rZXlzX3NldHRpbmdzLnBuZw==\" width=\"801\" height=\"543\">\n\nCongrats, you're now ready to start accepting Bitcoin lightning payments! You can skip to the API Collection section below and start making API requests.\n\n# API Overview\n\n## Hosted Checkout\n\nMinatoPay provides a responsive prebuilt checkout page with great user experience that you can use out of the box.\n\n<img src=\"https://content.pstmn.io/4d8cb8e9-a489-47a8-9af1-2e6e9eca96b4/ZmluYWxfY2hlY2tvdXQuZ2lm\" width=\"1560\" height=\"1332\">\n\nYou can use MinatoPay's hosted checkout by redirecting the user to [https://checkout.minatopay.com/](https://checkout.minatopay.com/<invoice_id>){invoice_id}\n\nWhere `{invoice_id}` is the id of your invoice. After the user pays, they will be redirected to the `success_url` that you provide when creating the invoice.\n\n## Validating Webhook Events\n\nMinatoPay sends webhooks for certain events, such as when invoices are paid or withdrawals are completed. See the collection below for examples.\n\nMinatoPay signs all webhook events it sends to your endpoints with a `hashed_order` field on the event payload. This allows you to validate that the events were sent by MinatoPay and not by a third party.\n\nYou can verify the signatures by computing an HMAC with the SHA256 hash function. Use the used on the `Invoice` or `Withdrawal` creation as the key, and the `Invoice` or `Withdrawal` id as the message.\n\nFor example, you can validate an `Invoice` webhook event with the following if you are using NodeJS:\n\n``` javascript\nconst crypto = require('crypto');\nconst secret = {{api_key}}; //You have to edit this line\nconst message = {{invoice.id}}; //You have to edit this line\nconst received = {{hashed_order}}; //You have to edit this line\nconst hmac = crypto.createHmac('sha256', secret);\nconst hmac_result = hmac.update(message).digest('base64');\nif (hmac_result === received) {\n    //Signature is valid\n}\nelse {\n    //Signature is invalid. Ignore.\n}\n\n```\n\nWithdrawal webhook events are validated in the same exact way:\n\n``` javascript\nconst crypto = require('crypto');\nconst secret = {{api_key}}; //You have to edit this line\nconst message = {{withdrawal.id}}; //You have to edit this line\nconst received = {{hashed_order}}; //You have to edit this line\nconst hmac = crypto.createHmac('sha256', secret);\nconst hmac_result = hmac.update(message).digest('base64');\nif (hmac_result === received) {\n    //Signature is valid\n}\nelse {\n    //Signature is invalid. Ignore.\n}\n\n```\n\n# API Collection\n\nBelow you can find the API collection. Feel free to fork it so that you can start running these API requests asap.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"23311215","team":4030915,"collectionId":"14c7081d-4676-403a-aa0b-2a5e8b667f43","publishedId":"2s7YzwomAB","public":true,"publicUrl":"https://documenter-api.postman.tech/view/23311215/2s7YzwomAB","privateUrl":"https://go.postman.co/documentation/23311215-14c7081d-4676-403a-aa0b-2a5e8b667f43","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-single-column","customisation":null,"version":"8.10.1","publishDate":"2022-09-20T04:00:02.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"MinatoPay.com Environment","id":"c50b8a27-a7cd-4dd4-8784-4bb9b8748413","owner":"23311215","values":[{"key":"api_key","value":"","enabled":true,"type":"default"}],"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/a87094ffbdc97d85b278cfbfac6ddfe16c63cb7dc9bf2158493932b28f66d19a","favicon":""},"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":"MinatoPay.com Environment","value":"23311215-c50b8a27-a7cd-4dd4-8784-4bb9b8748413"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2s7YzwomAB"}