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
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
charged_currency
optional
string
Account currency to send the funds from
charged_amount_to_send
optional
string
An exact amount that will be sent. Cryptopay fees will be debited from your account, not from transaction amount
charged_amount
optional
number
An amount specified will be charged from your account. Cryptopay fees will be deducted from this amount
address
required
string
A recipient's cryptocurrency wallet address
custom_id
required
string
Payment reference ID in your system
force_commit
optional
string
Set false by default. Use false for two-step transfer and commit it within 30 seconds. Use true for instant withdrawal
received_amount
optional
number
Use it instead of charged_amount to set the exact amount to be received by a recipient
received_currency
optional
string
Cryptocurrency type
201: Created
{
"id": "f04d3cac-837a-4245-840d-1b525a4d693d",
"custom_id": "113562013",
"address": "2MyYeAkU162aMh3otEhYHP9yhUR7xqS7S1r",
"txid": null,
"status": "new",
"charged_amount": "10.0",
"charged_currency": "EUR",
"received_amount": "0.00182832",
"received_currency": "BTC",
"network_fee": "0.0001",
"exchange": {
"pair": "BTCEUR",
"rate": "5133.9963",
"fee": "0.1",
"fee_currency": "EUR"
},
"risk": {
"score": 0.0,
"level": "low",
"resource_name": "default",
"resource_category": "unknown"
},
"created_at": "2019-05-02T12:08:46Z"
}

Withdraws from fiat accounts

If you want to send 10 EUR in bitcoins to a bitcoin address, you need to construct your API request body using the following parameters.

{
"charged_currency": "EUR",
"charged_amount_to_send": 10,
"address": "2N122JKRz52gokTmaVYNiMA43qvdSqnhLGV",
"received_currency": "BTC"
}

In this scenario, Cryptopay will send a bitcoin transaction which amount will be equivalent to 10 EUR.

API call example.

curl -X POST \
https://business.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"}'

Withdraws from cryptocurrency accounts

If you want to send a bitcoin transaction with the amount of 0.1 BTC, you need to construct your API request body using the following parameters.

{
"charged_currency": "BTC",
"address": "2N122JKRz52gokTmaVYNiMA43qvdSqnhLGV",
"received_amount": "0.1",
"received_currency": "BTC"
}

In this scenario, Cryptopay will send a bitcoin transaction which amount will be 0.1 BTC.

Response schema.

Parameter

Type

Description

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 a 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 a miner fee section

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. Cryptopay

resource_category

string

A resource category the external wallet address relates to e.g. Exchange

created_at

string

Coin withdrawal creation date and time