{"_id":"56326ea0df556c0d00cd08ec","parentDoc":null,"project":"544fc17e698ab40800b4f891","__v":6,"editedParams":true,"user":"544fc065698ab40800b4f888","version":{"_id":"56326e9cdf556c0d00cd08ca","project":"544fc17e698ab40800b4f891","__v":2,"createdAt":"2015-10-29T19:08:12.724Z","releaseDate":"2015-10-29T19:08:12.724Z","categories":["56326e9ddf556c0d00cd08cb","56326e9ddf556c0d00cd08cc","56326e9ddf556c0d00cd08cd","56326e9ddf556c0d00cd08ce","56326e9ddf556c0d00cd08cf","56326e9ddf556c0d00cd08d0","56326e9ddf556c0d00cd08d1","56326e9ddf556c0d00cd08d2","56326e9ddf556c0d00cd08d3","56326e9ddf556c0d00cd08d4","56d942ac337fd11300d6a251"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"collector","version_clean":"2.1.0","version":"2.1"},"category":{"_id":"56326e9ddf556c0d00cd08d0","__v":2,"pages":["56326ea0df556c0d00cd08ec","56326ea0df556c0d00cd08ed","56e92b441996862200fd7f2e"],"project":"544fc17e698ab40800b4f891","version":"56326e9cdf556c0d00cd08ca","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-01T05:42:12.353Z","from_sync":false,"order":5,"slug":"cash-out","title":"Cash Out"},"editedParams2":true,"updates":["58fa56aa2eb7b82500c471d4"],"next":{"pages":[],"description":""},"createdAt":"2015-05-01T07:33:10.517Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[{"language":"python","code":"import json\nimport requests\n\nTOKEN = 'YOUR TOKEN'\nurl = 'https://coins.ph/api/v2/sellorder'\n\nheaders = {\n    'Authorization': 'Bearer {}'.format(TOKEN),\n    'Content-Type': 'application/json;charset=UTF-8',\n    'Accept': 'application/json'\n}\n\nbody = json.dumps({\n    'amount': 10501\n    'currency': 'PHP',\n    'payment_outlet': 'bdo',\n    'rate': 10501,\n    'pay_with_wallet': 'PBTC',\n    'bank_account_number': 1234,\n    'bank_account_name': 'Bob'\n})\n\nrequests.post(url, headers=headers, data=body)","name":""}]},"method":"post","results":{"codes":[{"code":"{\n  \"order\": {\n    \"btc_amount\": 0.5,\n    \"confirmation_code\": \"9d6eb\",\n    \"expires_epoch\": \"1402483355\",\n    \"fields\": {\n      \"bank_account_name\": \"John Smith\",\n      \"bank_account_number\": \"0123456789\"\n    },\n    \"id\": \"9d6eb8f98b754cd7aa9d8d930054cda1\",\n    \"payment_outlet_id\": \"bdo\",\n    \"qr_img_uri\": \"https://some.url\",\n    \"user_uri\": \"https://coins.ph/sellorder/9d6eb8f98b754cd7aa9d8d930054cda1\",\n    \"due_btc_amount\": \"0.5\",\n    \"wallet_address\": \"3MTaArYfiHQK6jwjYJm17jsKDU2VQStw7d\"\n  },\n  \"success\": true\n}\n","language":"json","status":201,"name":""}]},"auth":"required","params":[{"_id":"55432c36795b590d001dc86e","ref":"","in":"body","required":false,"desc":"The expected amount of fiat currency to cash out. Use this instead of `base_amount` if you would like to compute the fees yourself.","default":"","type":"double","name":"amount"},{"_id":"565d2885f3e9360d00823f1f","ref":"","in":"body","required":false,"desc":"The amount of fiat currency to cash out, before fees. Use this instead of `amount` to have the API compute fees for you.","default":"","type":"double","name":"base_amount"},{"_id":"55432c36795b590d001dc86d","ref":"","in":"body","required":true,"desc":"ISO 4217 fiat currency symbol for the specified amount (ie, \"PHP\", \"USD\", \"SGD\")","default":"","type":"string","name":"currency"},{"_id":"55432c36795b590d001dc86c","ref":"","in":"body","required":false,"desc":"Optional. Used for validating the current rate. Equivalent amount in settlement currency of 1BTC. The system will respond with an error if this value is outdated. Current rates can be retrieved via the [quoter](doc:market-rates).","default":"","type":"int","name":"rate"},{"_id":"55432c36795b590d001dc86b","ref":"","in":"body","required":true,"desc":"ID of the payout outlet to use for the cash out","default":"","type":"string","name":"payment_outlet"},{"_id":"55432c36795b590d001dc86a","ref":"","in":"body","required":false,"desc":"Optional. If provided, indicates whether the cash out funds should be taken from the user's wallet. Valid values are `BTC` (to pay with the BTC wallet) and `PBTC` (to pay with the PHP wallet).","default":"","type":"string","name":"pay_with_wallet"},{"_id":"55432c36795b590d001dc869","ref":"","in":"body","required":true,"desc":"Payment outlets have different required fields such as, and are not limited to, `first_name`, `bank_account_name`, `bank_account_number`, etc. These are listed as **required_fields** when retrieving a sell quote. Please refer to the [Payin-Outlets](http://docs.coins.asia/docs/payin-outlets) for more information.","default":"","type":"string","name":"*varying field param*"},{"_id":"576cee315738570e00ff0822","ref":"","in":"body","required":true,"desc":"First name of the sender.","default":"","type":"string","name":"sender_first_name"},{"_id":"576cee315738570e00ff0821","ref":"","in":"body","required":false,"desc":"Middle name of the sender.","default":"","type":"string","name":"sender_middle_name"},{"_id":"576cee315738570e00ff0820","ref":"","in":"body","required":true,"desc":"Last name of the sender.","default":"","type":"string","name":"sender_last_name"},{"_id":"576cee315738570e00ff081f","ref":"","in":"body","required":true,"desc":"The street address of the sender.","default":"","type":"string","name":"sender_address"},{"_id":"576cee315738570e00ff081e","ref":"","in":"body","required":true,"desc":"The city of the sender.","default":"","type":"string","name":"sender_city"},{"_id":"576cee315738570e00ff081d","ref":"","in":"body","required":false,"desc":"The province or state of the sender.","default":"","type":"string","name":"sender_province"},{"_id":"576cee315738570e00ff081c","ref":"","in":"body","required":true,"desc":"The country of the sender. (ISO 3166-1 alpha-2 code)","default":"","type":"string","name":"sender_country"},{"_id":"576cee315738570e00ff081b","ref":"","in":"body","required":false,"desc":"The postal code (ZIP code) of the sender.","default":"","type":"string","name":"sender_postal_code"},{"_id":"576cee315738570e00ff081a","ref":"","in":"body","required":false,"desc":"(required if email is empty) Phone/Mobile number of the sender including country code (\"+631234567890\" format.)","default":"","type":"string","name":"sender_phone"},{"_id":"576cee315738570e00ff0819","ref":"","in":"body","required":false,"desc":"(required if sender_phone is empty) Email address of the sender.","default":"","type":"string","name":"sender_email"},{"_id":"57735123da551f0e00be5ccf","ref":"","in":"body","required":false,"desc":"Name of the company sending out the funds.","default":"","type":"string","name":"sender_company_name"},{"_id":"57ab29a639c2fd190019183e","ref":"","in":"body","required":false,"desc":"A unique reference provided by the API caller which is used as an alternative `id` for a particular sell order. If a sell order has already been created with the same reference, the new sell order will not be created. Uniqueness is scoped per API user.","default":"","type":"string","name":"external_transaction_id"}],"url":"/api/v2/sellorder/"},"isReference":false,"order":0,"body":"A sellorder represents a cashout, wherein users can send their details and their preferred cashout option.\n\nFor business partners, please see this [link](http://docs.coins.asia/v2.1/docs/cash-out-for-business-account).\n\n## Sending to another Coins Account\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"This will count toward your cash-out limits.\"\n}\n[/block]\nYou can also transfer funds to another Coins account by using this endpoint.\n\n### Example JSON Payload\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"payment_outlet\\\": \\\"coins_transfer\\\",\\n  \\\"amount\\\": \\\"5\\\",\\n  \\\"currency\\\": \\\"PHP\\\",\\n  \\\"target_address\\\": \\\"test:::at:::coins.ph\\\",  // This can either be an email or a mobile phone number.\\n  \\\"pay_with_wallet\\\": \\\"PBTC\\\"  // Specify the wallet you want the funds to come from.\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Errors\n\n* HTTP 400 **Invalid currency '{}'.** The provided currency is not supported.\n\n* HTTP 400 **We've detected a possible duplicate of this transaction. Please refresh and check your history if your order has already been placed. Otherwise, please try again.** For sell orders that provide a nonce, this means the provided nonce is already being used.\n\n* HTTP 400 **{outlet_name} is temporarily unavailable. We apologize for the inconvenience.** The provided payment outlet is currently disabled.\n\n* HTTP 400 **{field_name} is required for {outlet_name} payments.** The required field of a payment outlet was not present in the request.\n\n* HTTP 400 **Incorrect verification code** The provided two-factor authentication code is invalid.\n\n* HTTP 400 **payment_outlet - Please select the payment outlet of your choice** Payment outlet is not provided.\n\n* HTTP 422 **Invalid parameters.** The provided request body cannot be parsed.\n\n* HTTP 400 **Please provide btc_amount, amount or base_amount** One of `btc_amount`, `amount`, or `base_amount` should be provided in the request.\n\n* HTTP 400 **It looks like the exchange rate has just changed. Please review and continue.** This occurs when `rate` is provided during the request and it does not match the current market rate.\n\n### Server side errors\n\n* HTTP 500 **Unable to create order at this time** The sell order API is out of service.","excerpt":"Create a new sellorder. For business partners, please see this [link](http://docs.coins.asia/v2.1/docs/cash-out-for-business-account)","slug":"sellorder","type":"endpoint","title":"sellorder"}

postsellorder

Create a new sellorder. For business partners, please see this [link](http://docs.coins.asia/v2.1/docs/cash-out-for-business-account)

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

amount:
double
The expected amount of fiat currency to cash out. Use this instead of `base_amount` if you would like to compute the fees yourself.
base_amount:
double
The amount of fiat currency to cash out, before fees. Use this instead of `amount` to have the API compute fees for you.
currency:
required
string
ISO 4217 fiat currency symbol for the specified amount (ie, "PHP", "USD", "SGD")
rate:
integer
Optional. Used for validating the current rate. Equivalent amount in settlement currency of 1BTC. The system will respond with an error if this value is outdated. Current rates can be retrieved via the [quoter](doc:market-rates).
payment_outlet:
required
string
ID of the payout outlet to use for the cash out
pay_with_wallet:
string
Optional. If provided, indicates whether the cash out funds should be taken from the user's wallet. Valid values are `BTC` (to pay with the BTC wallet) and `PBTC` (to pay with the PHP wallet).
varying:
required
string
Payment outlets have different required fields such as, and are not limited to, `first_name`, `bank_account_name`, `bank_account_number`, etc. These are listed as **required_fields** when retrieving a sell quote. Please refer to the [Payin-Outlets](http://docs.coins.asia/docs/payin-outlets) for more information.
sender_first_name:
required
string
First name of the sender.
sender_middle_name:
string
Middle name of the sender.
sender_last_name:
required
string
Last name of the sender.
sender_address:
required
string
The street address of the sender.
sender_city:
required
string
The city of the sender.
sender_province:
string
The province or state of the sender.
sender_country:
required
string
The country of the sender. (ISO 3166-1 alpha-2 code)
sender_postal_code:
string
The postal code (ZIP code) of the sender.
sender_phone:
string
(required if email is empty) Phone/Mobile number of the sender including country code ("+631234567890" format.)
sender_email:
string
(required if sender_phone is empty) Email address of the sender.
sender_company_name:
string
Name of the company sending out the funds.
external_transaction_id:
string
A unique reference provided by the API caller which is used as an alternative `id` for a particular sell order. If a sell order has already been created with the same reference, the new sell order will not be created. Uniqueness is scoped per API user.

Examples


Result Format


Documentation

A sellorder represents a cashout, wherein users can send their details and their preferred cashout option. For business partners, please see this [link](http://docs.coins.asia/v2.1/docs/cash-out-for-business-account). ## Sending to another Coins Account [block:callout] { "type": "warning", "body": "This will count toward your cash-out limits." } [/block] You can also transfer funds to another Coins account by using this endpoint. ### Example JSON Payload [block:code] { "codes": [ { "code": "{\n \"payment_outlet\": \"coins_transfer\",\n \"amount\": \"5\",\n \"currency\": \"PHP\",\n \"target_address\": \"test@coins.ph\", // This can either be an email or a mobile phone number.\n \"pay_with_wallet\": \"PBTC\" // Specify the wallet you want the funds to come from.\n}", "language": "json" } ] } [/block] ## Errors * HTTP 400 **Invalid currency '{}'.** The provided currency is not supported. * HTTP 400 **We've detected a possible duplicate of this transaction. Please refresh and check your history if your order has already been placed. Otherwise, please try again.** For sell orders that provide a nonce, this means the provided nonce is already being used. * HTTP 400 **{outlet_name} is temporarily unavailable. We apologize for the inconvenience.** The provided payment outlet is currently disabled. * HTTP 400 **{field_name} is required for {outlet_name} payments.** The required field of a payment outlet was not present in the request. * HTTP 400 **Incorrect verification code** The provided two-factor authentication code is invalid. * HTTP 400 **payment_outlet - Please select the payment outlet of your choice** Payment outlet is not provided. * HTTP 422 **Invalid parameters.** The provided request body cannot be parsed. * HTTP 400 **Please provide btc_amount, amount or base_amount** One of `btc_amount`, `amount`, or `base_amount` should be provided in the request. * HTTP 400 **It looks like the exchange rate has just changed. Please review and continue.** This occurs when `rate` is provided during the request and it does not match the current market rate. ### Server side errors * HTTP 500 **Unable to create order at this time** The sell order API is out of service.