{"_id":"5adcc1185cd1890003da8168","category":{"_id":"5adcc1185cd1890003da8166","version":"5adcc1185cd1890003da8165","project":"5530bfac57cea10d00a3aa3b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-17T08:09:17.710Z","from_sync":false,"order":1,"slug":"documentation","title":"Documentation"},"parentDoc":null,"project":"5530bfac57cea10d00a3aa3b","user":"5530bf7457cea10d00a3aa3a","version":{"_id":"5adcc1185cd1890003da8165","project":"5530bfac57cea10d00a3aa3b","__v":3,"createdAt":"2018-04-22T17:06:32.152Z","releaseDate":"2018-04-22T17:06:32.152Z","categories":["5adcc1185cd1890003da8166","5adcc1185cd1890003da8167","5adcf4b3ce4b3f00035317e9","5adfb8e9452bd900036d115b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"__v":0,"updates":["58b088cef634c737009157d4"],"next":{"pages":[],"description":""},"createdAt":"2015-08-19T07:19:00.870Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7507b5a-coingate_api_diagram.jpg\",\n        \"coingate_api_diagram.jpg\",\n        2162,\n        2099,\n        \"#2eb274\"\n      ],\n      \"caption\": \"\"\n    }\n  ]\n}\n[/block]\n1. Call [Create Order](doc:create-order) API method to create an order in the CoinGate system.\n\n2. CoinGate checks if the order is valid.\n\n      2a. If the order is valid, CoinGate responds with 200 HTTP status and returns [order data](doc:create-order). After receiving 200 HTTP status, you should redirect the buyer to ***payment_url*** address.\n\n      2b. If the order is not valid, CoinGate returns 422 (or another) error HTTP status and an error message (see [Errors](doc:common-errors)).\n\n3. When the buyer pays for the order, CoinGate sends [Payment Callback/Payment Notification](doc:payment-callback) to your ***callback_url***, which is defined when creating the order (see [Create Order](doc:create-order)). CoinGate also sends Payment Callback when order status is changed to canceled, expired or to any other status (see [Order Statuses](doc:order-statuses)). Please note that payment notifications are sent using **POST** method.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Environments\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**Live**\",\n    \"0-1\": \"`https://api.coingate.com/v2`\",\n    \"1-0\": \"**Sandbox**\",\n    \"1-1\": \"`https://api-sandbox.coingate.com/v2`\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n* If you wish to use **Live** environment, create an account and API credentials on https://coingate.com\n* If you wish to use **Sandbox** environment, create an account and API credentials on https://sandbox.coingate.com\n[block:api-header]\n{\n  \"title\": \"Limits and Quotas\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Orders\",\n    \"0-1\": \"**500 per hour per userid** (contact support to increase)\\nThis default value is the number of orders that can be created per hour. Reaching the limit will prevent further orders to be created before the hourly timer resets.\",\n    \"1-0\": \"Public API endpoints\",\n    \"1-1\": \"**10,000 per hour per IP address**\\nApplies to API methods that do not require authentication, such as Get Exchange Rate and List Exchange Rates (note that CoinGate exchange rates are updated every 60 seconds, therefore it is not recommended to call the API more often than every 60 seconds to retrieve the latest exchange rates).\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API Requests\"\n}\n[/block]\nAPI Requests are used to query the CoinGate API (examples: [Create Order](doc:create-order), [Get Order](doc:get-order)).\n\nTo review your API Requests, login to your CoinGate account, then go to API » Requests.\n\nAPI Request attributes:\n\n* Action - Which API method was queried.\n* Response - HTTP status returned by CoinGate.\n* Parameters - Parameters used to query the CoinGate API.\n* Response - Parameters returned by CoinGate.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/B2ELvNVCT2unLKj4ewy8_api-requests.png\",\n        \"api-requests.png\",\n        \"999\",\n        \"442\",\n        \"#306694\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Payment Callbacks (Payment Notifications)\"\n}\n[/block]\n[Payment Callback](doc:payment-callback) (Payment Notification) is a response which is sent after the order status changes (see [Order Statuses](doc:order-statuses)). CoinGate sends the Payment Callback to merchant's ***callback_url***, which is set during order creation (see [Create Order](doc:create-order)).\n\nTo review your Payment Callbacks, login to your CoinGate account, then go to API » Payment Callbacks.\n\nPayment Callback attributes:\n\n* **Response Status** - HTTP status returned by merchant.\n* **Response Data** - Data body returned by merchant.\n* **Callback Params** - Parameters sent by CoinGate to merchant's ***callback_url***.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/cffb98c-callbacks.png\",\n        \"callbacks.png\",\n        1020,\n        446,\n        \"#f0f0ee\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"POST Request\"\n}\n[/block]\nIn every POST method set **Content-Type: application/x-www-form-urlencoded** header.","excerpt":"","slug":"api-overview","type":"basic","title":"API Overview"}
[block:image] { "images": [ { "image": [ "https://files.readme.io/7507b5a-coingate_api_diagram.jpg", "coingate_api_diagram.jpg", 2162, 2099, "#2eb274" ], "caption": "" } ] } [/block] 1. Call [Create Order](doc:create-order) API method to create an order in the CoinGate system. 2. CoinGate checks if the order is valid. 2a. If the order is valid, CoinGate responds with 200 HTTP status and returns [order data](doc:create-order). After receiving 200 HTTP status, you should redirect the buyer to ***payment_url*** address. 2b. If the order is not valid, CoinGate returns 422 (or another) error HTTP status and an error message (see [Errors](doc:common-errors)). 3. When the buyer pays for the order, CoinGate sends [Payment Callback/Payment Notification](doc:payment-callback) to your ***callback_url***, which is defined when creating the order (see [Create Order](doc:create-order)). CoinGate also sends Payment Callback when order status is changed to canceled, expired or to any other status (see [Order Statuses](doc:order-statuses)). Please note that payment notifications are sent using **POST** method. [block:api-header] { "type": "basic", "title": "Environments" } [/block] [block:parameters] { "data": { "0-0": "**Live**", "0-1": "`https://api.coingate.com/v2`", "1-0": "**Sandbox**", "1-1": "`https://api-sandbox.coingate.com/v2`" }, "cols": 2, "rows": 2 } [/block] * If you wish to use **Live** environment, create an account and API credentials on https://coingate.com * If you wish to use **Sandbox** environment, create an account and API credentials on https://sandbox.coingate.com [block:api-header] { "title": "Limits and Quotas" } [/block] [block:parameters] { "data": { "0-0": "Orders", "0-1": "**500 per hour per userid** (contact support to increase)\nThis default value is the number of orders that can be created per hour. Reaching the limit will prevent further orders to be created before the hourly timer resets.", "1-0": "Public API endpoints", "1-1": "**10,000 per hour per IP address**\nApplies to API methods that do not require authentication, such as Get Exchange Rate and List Exchange Rates (note that CoinGate exchange rates are updated every 60 seconds, therefore it is not recommended to call the API more often than every 60 seconds to retrieve the latest exchange rates)." }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "API Requests" } [/block] API Requests are used to query the CoinGate API (examples: [Create Order](doc:create-order), [Get Order](doc:get-order)). To review your API Requests, login to your CoinGate account, then go to API » Requests. API Request attributes: * Action - Which API method was queried. * Response - HTTP status returned by CoinGate. * Parameters - Parameters used to query the CoinGate API. * Response - Parameters returned by CoinGate. [block:image] { "images": [ { "image": [ "https://files.readme.io/B2ELvNVCT2unLKj4ewy8_api-requests.png", "api-requests.png", "999", "442", "#306694", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Payment Callbacks (Payment Notifications)" } [/block] [Payment Callback](doc:payment-callback) (Payment Notification) is a response which is sent after the order status changes (see [Order Statuses](doc:order-statuses)). CoinGate sends the Payment Callback to merchant's ***callback_url***, which is set during order creation (see [Create Order](doc:create-order)). To review your Payment Callbacks, login to your CoinGate account, then go to API » Payment Callbacks. Payment Callback attributes: * **Response Status** - HTTP status returned by merchant. * **Response Data** - Data body returned by merchant. * **Callback Params** - Parameters sent by CoinGate to merchant's ***callback_url***. [block:image] { "images": [ { "image": [ "https://files.readme.io/cffb98c-callbacks.png", "callbacks.png", 1020, 446, "#f0f0ee" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "POST Request" } [/block] In every POST method set **Content-Type: application/x-www-form-urlencoded** header.