Create a payment

post
Create a payment

https://business-sandbox.cryptopay.me/api/coin_withdrawals
This endpoint allows you to create a payment.
Request
Response
Request
Headers
Authorization
required
string
HMAC using API key and signature
Content-Type
required
string
application/json
Date
required
string
Current date in HTTP-date format
Query Parameters
customer_id
optional
string
The reference ID of your customer. See Customers section on the left for more information
network_fee_level
optional
string
slow, average or fast. average is used by default
charged_currency
optional
string
An account currency to send a transaction from
charged_amount_to_send
optional
string
An exact transaction amount to send. All applicable fees will be added on top of this amount and debited from your account
charged_amount
optional
number
All applicable fees will be deducted from this amount before processing a transaction instead of adding them on top it
address
required
string
A recipient's cryptocurrency wallet address. XRP addresses should always be accompanied with a destination tag 'address' + '?dt=' + '123'. If there is no destination tag to specify, leave it as 0, e.g. address?dt=0
custom_id
required
string
Payment reference ID in your system
force_commit
optional
string
Set false by default. Use false for two-step transfers and commit it within 30 seconds, otherwise your request will expire and no payout will be processed. Use true for instant withdrawal with no need to commit your initial request
received_amount
optional
number
An exact transaction amount to send. All applicable fees will be added on top of this amount and debited from your account. Use this parameter if you want to send a transactions from cryptocurrency accounts only
received_currency
optional
string
Cryptocurrency type
Response
201: Created
{
"id": "f04d3cac-837a-4245-840d-1b525a4d693d",
"custom_id": "113562013",
"address": "2MyYeAkU162aMh3otEhYHP9yhUR7xqS7S1r",
"txid": null,
"status": "pending",
"charged_amount": "10.17",
"charged_currency": "EUR",
"received_amount": "0.00103102",
"received_currency": "BTC",
"network_fee": "0.0000054",
"network_fee_level": "average",
"fee": "0.0",
"fee_currency": "BTC",
"exchange": {
"pair": "BTCEUR",
"rate": "9699.0409",
"fee": "0.11",
"fee_currency": "EUR"
},
"risk": null,
"created_at": "2019-05-02T12:08:46Z"
}

Errors:

422 Unprocessable entity in case you exceed your account balance:

{
"error": {
"code": "invalid",
"message": "invalid",
"details": [
{
"code": "must_be_less_than_or_equal",
"target": "charged_amount",
"message": "must be less than or equal to 167.75222297",
"args": {
"value": "167.75222297"
}
},
{
"code": "must_be_less_than_or_equal",
"target": "received_amount",
"message": "must be less than or equal to 12500.0",
"args": {
"value": "12500.0"
}
}
]
},
"meta": {
"request_id": "0919053f1c2675f62824bc3aabed3697"
}
}

422 Unprocessable entity in case a payout amount os less than 5 EUR:

{
"error": {
"code": "invalid",
"message": "invalid",
"details": [
{
"code": "must_be_greater_than_or_equal",
"target": "charged_amount_to_send",
"message": "must be greater than or equal to 5.0",
"args": {
"value": "5.0"
}
}
]
},
"meta": {
"request_id": "6fd8b3b615f1fca80e1b29f7f102e090"
}
}

422 Unprocessable entity in case a destination address is evaluated as high-risk:

{
"error": {
"code": "high_risk_address",
"message": "We were unable to process your request as the address of the recipient may be associated with resource primarily used for unlawful activities",
"details": []
},
"meta": {
"request_id": "e1327567dc4189901aa2463e85b96b93"
}
}

422 Unprocessable entity in case you specified currency that we do not support:

{
"error": {
"code": "invalid",
"message": "invalid",
"details": [
{
"code": "must_be_included_in",
"target": "charged_currency",
"message": "must be one of: BTC, LTC, GBP, CNY, TRY, USD, RUB, KRW, NOK, INR, BCH, ETH, JPY, CAD, THB, AUD, HKD, MYR, NZD, TWD, MXN, BRL, COP, SEK, PLN, HUF, IDR, VND, XRP, EUR",
"args": {
"list": [
"BTC",
"LTC",
"GBP",
"CNY",
"TRY",
"USD",
"RUB",
"KRW",
"NOK",
"INR",
"BCH",
"ETH",
"JPY",
"CAD",
"THB",
"AUD",
"HKD",
"MYR",
"NZD",
"TWD",
"MXN",
"BRL",
"COP",
"SEK",
"PLN",
"HUF",
"IDR",
"VND",
"XRP",
"EUR"
]
}
}
]
},
"meta": {
"request_id": "1cdd48b0d123f5445991e25eb1ce6f50"
}
}

API call example.

curl -X POST \
https://business-sandbox.cryptopay.me/api/coin_withdrawals \
-H 'Authorization: HMAC ***' \
-H 'Content-Type: application/json' \
-H 'Date: Tue, 19 Mar 2019 10:11:40 GMT' \
-d '{"charged_currency":"EUR", "charged_amount_to_send":"10", "address":"2N122JKRz52gokTmaVYNiMA43qvdSqnhLGV", "received_currency":"BTC"}'

Response schema.

Parameter

Type

Description

customer_id

type

The reference ID of your customer. See Customers section on the left for more information

id

string

Coin withdrawal ID

custom_id

string

Payment reference ID in your system

address

string

Recipient's cryptocurrency wallet address

txid

string

Cryptocurrency transaction ID on the blockchain

status

string

Coin withdrawal status. Refer to the status list‚Äč

charged_amount

string

Payment amount. Amount charged from your account

charged_currency

string

Account currency the payment has been sent from

received_amount

string

Cryptocurrency transaction amount. Exact amount received by a recipient

received_currency

string

Cryptocurrency type

network_fee

string

Network fee amount. Refer to the network fee section

network_fee_level

string

slow, average or fast

exchange

object

Exchange details

pair

string

Currency pair

rate

string

Exchange rate

fee

string

Exchange fee

fee_currency

string

Exchange fee currency

risk

object

Cryptocurrency transaction risk level details

score

number

Transaction risk score

level

string

Transaction risk level. low, medium or high depending on the score value

resource_name

string

A resource name the external wallet address relates to e.g. Bitstamp. Can be default if no data obtained

resource_category

string

A resource category the external wallet address relates to e.g. Exchange. Can be unknown if no data obtained

created_at

string

Coin withdrawal creation date and time