{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/orders","auth":"required","examples":{"codes":[{"code":"curl -X \"POST\" \"https://api-sandbox.coingate.com/v2/orders\" \\\n     -H 'Authorization: Token YOUR_COINGATE_API_KEY' \\\n     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \\\n     --data-urlencode \"title=Order #111\" \\\n     --data-urlencode \"price_amount=1229\" \\\n     --data-urlencode \"price_currency=EUR\" \\\n     --data-urlencode \"receive_currency=EUR\" \\\n     --data-urlencode \"callback_url=https://coingate.requestcatcher.com/payment\" \\\n     --data-urlencode \"success_url=http://example.com/success\" \\\n     --data-urlencode \"cancel_url=http://example.com/cancel\" \\\n     --data-urlencode \"order_id=111\" \\\n     --data-urlencode \"description=1 x Apple iPhone 12 \"\n","language":"curl"}]},"method":"post","results":{"codes":[{"name":null,"code":"{\n  \"id\": 390551,\n  \"status\": \"new\",\n  \"do_not_convert\": false,\n  \"price_currency\": \"EUR\",\n  \"price_amount\": \"1229.0\",\n  \"lightning_network\": false,\n  \"receive_currency\": \"EUR\",\n  \"receive_amount\": \"\",\n  \"created_at\": \"2021-06-22T12:37:20+00:00\",\n  \"order_id\": \"111\",\n  \"payment_url\": \"https://pay-sandbox.coingate.com/invoice/def7beb5-35c2-4945-b9f0-9747c078ce8e\",\n  \"underpaid_amount\": \"0\",\n  \"overpaid_amount\": \"0\",\n  \"is_refundable\": false,\n  \"token\": \"XPVsoxirj5TFprqJM5qrPufWyzqqtA\"\n}","language":"json","status":200},{"name":"","code":"{\n    \"message\": \"Order is not valid\",\n    \"reason\": \"OrderIsNotValid\",\n    \"errors\": [\n        \"Price can't be blank\",\n        \"Price is not a number\",\n        \"Btc amount can't be blank\",\n        \"Btc amount is not a number\"\n    ]\n}","language":"json","status":422}]},"settings":"5adcc50db719b20003516400","params":[{"name":"order_id","type":"string","default":"","desc":"Merchant's custom order ID. We recommend using a unique order ID. Example: *CGORDER-12345*.","required":false,"in":"body","ref":"","_id":"55d37cb1b9ef4435006dedbe"},{"name":"price_amount","type":"double","default":"","desc":"The price set by the merchant. Example: *1050.99*.","required":true,"in":"body","ref":"","_id":"55d37cb1b9ef4435006dedbd"},{"name":"price_currency","type":"string","default":"","desc":"[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code which defines the currency in which you wish to price your merchandise; used to define price parameter. [Supported currencies](https://developer.coingate.com/docs/currencies)","required":true,"in":"body","ref":"","_id":"55d37d670168850d0073f1ba"},{"name":"receive_currency","type":"string","default":"","desc":"[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code which defines the currency in which you wish to receive your settlements. Currency conversions are done by CoinGate. Possible values: fiat - *EUR*; stablecoin - *USDT*; crypto: *BTC*, *LTC*, *ETH* or *DO_NOT_CONVERT*. **Note**: use *DO_NOT_CONVERT* to keep payments received in original currency (Altcoin payments will be converted to BTC). With *DO_NOT_CONVERT* you can also extend invoice expiration time up to 24 hours. [Supported currencies](https://developer.coingate.com/docs/currencies)","required":true,"in":"body","ref":"","_id":"55d37e6ff77e6d0d00b1b138"},{"name":"title","type":"string","default":"","desc":"Max 150 characters. Example: product title (Apple iPhone 6), order id (MyShop Order #12345), cart id (Cart #00004335).","required":false,"in":"body","ref":"","_id":"55d37ee3f77e6d0d00b1b13c"},{"name":"description","type":"string","default":"","desc":"More details about this order. Max 500 characters. It can be cart items, product details or other information. Example: 1 x Apple iPhone 6, 1 x Apple MacBook Air.","required":false,"in":"body","ref":"","_id":"55d37ee3f77e6d0d00b1b13b"},{"name":"callback_url","type":"string","default":"","desc":"Send an automated message to Merchant URL when order status is changed. For testing you can use [requestcatcher.com](https://requestcatcher.com) tool.","required":false,"in":"body","ref":"","_id":"55d37f6bb9ef4435006dedc8"},{"name":"cancel_url","type":"string","default":"","desc":"Redirect to Merchant URL when buyer cancels the order","required":false,"in":"body","ref":"","_id":"55d37f6bb9ef4435006dedc7"},{"name":"success_url","type":"string","default":"","desc":"Redirect to Merchant URL after successful payment","required":false,"in":"body","ref":"","_id":"55d37f6bb9ef4435006dedc6"},{"name":"token","type":"string","default":"","desc":"Your custom token to validate payment callback (notification).","required":false,"in":"body","ref":"","_id":"5adccddeb719b2000351643a"},{"name":"purchaser_email","type":"string","default":"","desc":"Email address of the purchaser (payee) provided will be pre-filled on the invoice.","required":false,"in":"body","ref":"","_id":"6024ea89b0dcf5002cace9d6"}]},"next":{"description":"","pages":[]},"title":"Create Order","type":"endpoint","slug":"create-order","excerpt":"Create order at CoinGate and redirect shopper to invoice (payment_url).","body":"The order is placed with the \"Create Order\" API method. From the user's point of view, at the moment of creating the order, the user is redirected to (*payment_url*) our payment page (invoice), where shopper can see the payment amount, select the desired payment currency and complete the payment.\n\nNote on the *receive_currency* parameter - this is your settlement currency. When EUR or USD is selected, all your received payments are immediately settled on exchanges to guarantee a fixed payout for each order. By selecting BTC, ETH, LTC or BCH as your settlement currency, you will automatically be credited with the chosen cryptocurrency (e.g. if BTC is your receive_currency and your customer pays with ETH, you will be credited BTC according to the real-time market rate locked at the moment the invoice is generated). To keep the coins which your customers pay with, use DO_NOT_CONVERT as your receive_currency (e.g. if a customer pays in BTC, you will be credited BTC, and if the customer pays in ETH, you will be credited with ETH). Please contact our support for further clarification, if needed.","updates":["5c2020afea332e0024141656","5cc63f28bc8295000ee8e5c7","5e147a8a292899001fc8b84f","60474a9252c9880011962e04","60901c1758cff3002ae92f0b"],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5adcc1185cd1890003da816d","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Payment Gateway","slug":"orders","order":2,"from_sync":false,"reference":false,"_id":"5adcc1185cd1890003da8167","version":"5adcc1185cd1890003da8165","project":"5530bfac57cea10d00a3aa3b","createdAt":"2015-08-18T18:14:59.726Z","__v":1},"project":"5530bfac57cea10d00a3aa3b","user":"5530bf7457cea10d00a3aa3a","parentDoc":null,"version":{"version":"2","version_clean":"2.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5adcc1185cd1890003da8166","5adcc1185cd1890003da8167","5adcf4b3ce4b3f00035317e9","5adfb8e9452bd900036d115b","5e7b51281ac49702d745882c","5e7b526560c6cc004f25ca3e"],"_id":"5adcc1185cd1890003da8165","project":"5530bfac57cea10d00a3aa3b","createdAt":"2018-04-22T17:06:32.152Z","releaseDate":"2018-04-22T17:06:32.152Z","__v":5},"createdAt":"2015-08-18T18:42:57.791Z","githubsync":"","__v":50}

postCreate Order

Create order at CoinGate and redirect shopper to invoice (payment_url).

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

order_id:
string
Merchant's custom order ID. We recommend using a unique order ID. Example: *CGORDER-12345*.
price_amount:
required
double
The price set by the merchant. Example: *1050.99*.
price_currency:
required
string
[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code which defines the currency in which you wish to price your merchandise; used to define price parameter. [Supported currencies](https://developer.coingate.com/docs/currencies)
receive_currency:
required
string
[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code which defines the currency in which you wish to receive your settlements. Currency conversions are done by CoinGate. Possible values: fiat - *EUR*; stablecoin - *USDT*; crypto: *BTC*, *LTC*, *ETH* or *DO_NOT_CONVERT*. **Note**: use *DO_NOT_CONVERT* to keep payments received in original currency (Altcoin payments will be converted to BTC). With *DO_NOT_CONVERT* you can also extend invoice expiration time up to 24 hours. [Supported currencies](https://developer.coingate.com/docs/currencies)
title:
string
Max 150 characters. Example: product title (Apple iPhone 6), order id (MyShop Order #12345), cart id (Cart #00004335).
description:
string
More details about this order. Max 500 characters. It can be cart items, product details or other information. Example: 1 x Apple iPhone 6, 1 x Apple MacBook Air.
callback_url:
string
Send an automated message to Merchant URL when order status is changed. For testing you can use [requestcatcher.com](https://requestcatcher.com) tool.
cancel_url:
string
Redirect to Merchant URL when buyer cancels the order
success_url:
string
Redirect to Merchant URL after successful payment
token:
string
Your custom token to validate payment callback (notification).
purchaser_email:
string
Email address of the purchaser (payee) provided will be pre-filled on the invoice.

Examples


Result Format


Documentation

The order is placed with the "Create Order" API method. From the user's point of view, at the moment of creating the order, the user is redirected to (*payment_url*) our payment page (invoice), where shopper can see the payment amount, select the desired payment currency and complete the payment. Note on the *receive_currency* parameter - this is your settlement currency. When EUR or USD is selected, all your received payments are immediately settled on exchanges to guarantee a fixed payout for each order. By selecting BTC, ETH, LTC or BCH as your settlement currency, you will automatically be credited with the chosen cryptocurrency (e.g. if BTC is your receive_currency and your customer pays with ETH, you will be credited BTC according to the real-time market rate locked at the moment the invoice is generated). To keep the coins which your customers pay with, use DO_NOT_CONVERT as your receive_currency (e.g. if a customer pays in BTC, you will be credited BTC, and if the customer pays in ETH, you will be credited with ETH). Please contact our support for further clarification, if needed.