Create a Payout

Create a Payout

POST https://api.sandbox.coindirect.com/api/v1/pay/summary

This endpoint allows you to create payouts.

Headers

NameTypeDescription

Authorization

string

HAWK Token. See API Authentication page

Request Body

NameTypeDescription

payOutDetails

object

In this object you will want to specify such payout details as destination address, currency, code and procotol

payOutDetails.protocol

string

Only applicable when "currency": "USDT". Use ERC20 to send USDT on the Ethereum network. Use TRC20 to send USDT on the Tron network. Be careful! Sending funds to the wrong network will result in a total loss of your funds.

payOutDetails.code

string

Always crypto

payOutDetails.currency

string

Cryptocurrency code e.g. ETH, USDT, BTC etc

payOutDetails.address

string

Payout destination address e.g. 0x1A2E97Fd13C0610239C0B1CDBB0806F35ADff3f0

When sending XRP, please append ?dt= and the destination tag itself, e.g. rh6X8bZXE49xZhNwVx47K6Q6px7nDhaAdy?dt=778415029. Destination tags indicate the beneficiary or destination for a payment. For example, a payment to an exchange or gateway address can use a destination tag to indicate which customer to credit for the amount of the payment in that business's own systems. A payment to a merchant could indicate what item or cart the payment is buying. If the user has no destination tag, just pass ?dt=0.

merchantId

string

Merchant ID. You can find it on the "Merchant Details" page in your business account

type

string

Use OUT to send payments to external addresses

amount

number

Payment price

currency

string

Payment price currency. Can be any of supported by Coindirect currencies e.g. EUR, JPY etc

expiryMinutes

number

Indicates the payment window - for how long a payment will be valid. Once it is expired e.g. no transaction has been received during the payment window, the payment will update its status to EXPIRED

reference

string

Payment external ID

{
  "uuid": "0e135a7e-82e5-4b59-8682-d6e7db362c1d",
  "merchantId": "9a57c17a-1eef-48ff-83d0-b5892c99f767",
  "dateCreated": 1633010474797,
  "expiryDate": 1633014067303,
  "reference": "af1f5c35-a818-4493-957b-8678f6b90ff6",
  "type": "OUT",
  "status": "PROCESSING",
  "displayCurrency": {
    "currency": "JPY",
    "amount": 5E+3,
    "actual": 5E+3
  },
  "walletCurrency": {
    "currency": "EUR",
    "amount": 38.59,
    "actual": 38.59
  },
  "paidCurrency": {
    "currency": null,
    "amount": 0,
    "actual": 0
  },
  "feeCurrency": {
    "currency": "EUR",
    "amount": 0.38,
    "actual": 0.38
  },
  "displayRate": {
    "base": "EUR",
    "counter": "JPY",
    "rate": 129.567245400362788287
  },
  "exchangeRate": {
    "base": "USDT",
    "counter": "EUR",
    "rate": 0.545751261991275176
  },
  "address": {
    "protocol": null,
    "address": "THr6oYBp7mgUHiLoxYcqKtoKneKvEhyE22",
    "tag": "[]"
  },
  "redirectUrl": null,
  "returnUrl": null,
  "transactions": [
    {
      "dateCreated": 1633010478635,
      "dateConfirmed": null,
      "hash": null,
      "amount": 21.060541200000000000,
      "risk": "UNKNOWN",
      "networkFeeCurrency": null,
      "networkFeeAmount": null,
      "sources": null,
      "exchangeRate": {
        "base": "USDT",
        "counter": "EUR",
        "rate": 1.832336578300000000
      },
      "displayRate": {
        "base": "JPY",
        "counter": "USDT",
        "rate": 0.007718
      }
    }
  ]
}

When creating USDT payouts, please always specify a relevant protocol in a "payOutDetails.protocol" field in your POST /api/v1/pay/summary call.

The field value can be either "ERC20" or "TRC20" depending on what destination address you submit in an "address" field.

When sending USDT to the Ethereum network, specify ERC20.

When sending USDT to the Tron network, specify TRC20.

SENDING FUNDS TO THE WRONG NETWORK WILL RESULT IN THE TOTAL LOSS OF YOUR FUNDS.

Before you submit your request to create a payout transaction, we recommend validating a destination wallet address that the funds are supposed to be sent to. This will reduce a number of errors due to end-users who submit incomplete, incorrect or wrong addresses when requesting a withdrawal on your platform.

See https://developers.coindirect.com/api/payouts/validate-address.

curl -X "POST" "https://api.sandbox.coindirect.com/api/v1/pay/summary" \
     -H 'Authorization: Hawk id="B9jnE1U8eLblzHtNeJZRxfcq03CQKcmcP9FOrACMzXb1HfrxrePWsTfuP70JNns9", ts="1633010482", nonce="YdZMq9", mac="S3iPgcfv054VgvizxJzEyUcTiASSFlOT2ceQ8zmoHj4="' \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "amount": 5000,
  "reference": "b8879f09-b6fc-471e-813e-c27f8f87e2f8",
  "merchantId": "9a57c17a-1eef-48ff-83d0-b5892c99f767",
  "type": "OUT",
  "currency": "JPY",
  "expiryMinutes": 60,
  "payOutDetails": {
    "code": "crypto",
    "currency": "USDT",
    "protocol": "TRC20",
    "address": "THr6oYBp7mgUHiLoxYcqKtoKneKvEhyE22"
  }
}'

Response parameters

uuid

string

Payment UUID

merchantId

string

Merchant ID

dateCreated

long

Payment creation date and time

expiryDate

long

Payment expiry date

quoteExpiryDate

long

Quote expiry date

reference

string

Payment external ID

type

string

IN for inbound payments. OUT for outbound payments

status

string

Payment status. See the list of payment statuses in Payments How-Tos on the left

displayCurrency

object

Contains data about the payment price currency and amount

displayCurrency.currency

string

Payment price currency e.g. JPY

displayCurrency.amount

big decimal

Payment price amount

displayCurrency.actual

big decimal

The actual payment amount in price currency that the payment resulted in

walletCurrency

object

Contain data about both the payment's target wallet currency and the amount

walletCurrency.currency

string

The merchant's target wallet currency that the cryptocurrency payment will be converted and credited to

walletCurrency.amount

big decimal

The amount that will be received into the merchant's wallet if the customer sends the exact amount of cryptocurrency that they are supposed to send (see paidCurrency.amount)

walletCurrency.actual

big decimal

The actual amount that the merchant receives into their wallet after Coindirect converts cryptocurrency

paidCurrency

object

Contains data about the amount of cryptocurrency that the customer is supposed to send to the payment address. It also contains both the currency code and the actual amount of received cryptocurrency

paidCurrency.currency

string

Cryptocurrency code e.g. ETH

paidCurrency.amount

big decimal

The amount of cryptocurrency that is supposed to be sent to the payment address

paidCurrency.actual

big decimal

The actual amount of received cryptocurrency

feeCurrency

object

Contains data about payment fees

feeCurrency.currency

string

Fee currency code

feeCurrency.amount

big decimal

Fee amount that will be debited from the merchant's wallet balance if the customer sends the exact amount of cryptocurrency that they are supposed to send

feeCurrency.actual

big decimal

The actual fee amount that Coindirect debited from the merchant's wallet balance after processing the payment

displayRate

object

An object that contain data about the display rate.

displayRate.base

string

Base currency type

displayRate.counter

string

Couter currency type

displayRate.rate

big decmal

Rate

exchangeRate

object

An object that contains data about the paymen exchange rate

exchangeRate.base

string

Base currency code

exchangeRate.counter

string

Counter currency code

exchangeRate.rate

big decimal

Rate

address

object

Contains data about the cryptocurrency address and destination tag (in case of XRP)

address.protocol

string

The protocol type supported by the payment. If there are multiple protocols supported, see the data.address.alternatives array below

address.address

string

The payment address. This is the address that a customer needs to send their cryptocurrency to

address.tag

string

This is a payment destination tag. This fields isn't null when the paidCurrency.currency vlau is XRP. A destination tag should be viewable to the customer as destination tags indicate the beneficiary or destination for a payment. For example, a payment to an exchange or gateway address can use a destination tag to indicate which customer to credit for the amount of the payment in that business's own systems. A payment to a merchant could indicate what item or cart the payment is buying

address.uri

string

The destination address URI

address.alternatives[]

array

Fields are the same as in the case of the data.address array

redirectUrl

string

URL to the payment page that you can redirect your customers to

returnUrl

string

URL that the customer will be redirected to if they click a "Back to Merchant" button on the payment page

transactions[]

array

Contains data about received cryptocurrency transactions and exchange rates. If no transaction is received, it is empty

transactions[].dateCreated

long

Cryptocurrency transaction detection timestamp

transactions[].dateConfirmed

long

Cryptocurrency transaction confirmation timestamp

transactions[].hash

string

Cryptocurrency transaction hash

transactions[].amount

big decimal

Cryptocurrency transaction amount

transactions[].risk

object

Cryptocurrency transaction risk details

transactions[].risk.level

string

Cryptocurrency transaction risk levl. Can unknonw, low, medium or high

transactions[].resourceName

string

Cryptocurrency transaction resource name

transactions[].risk.resourceCategory

string

Cryptocurrency transaction resource category

transactions[].netwokFeeCurrency

string

Cryptocurrency transaction network fee details

transactions[].networkFeeAmount

big decimal

Cryptocurrency transaction

transactions[].sources

array, string

The wallet addresses that the cryptocurrency transaction was sent from

transactions[].exchangeRate

object

The exchange rate that was used to convert cryptocurrency to the wallet currency

transactions[].exchangeRate.base

string

Base currency

transactions[].exchangeRate.counter

string

Counter currency

transactions[].exchangeRate.rate

big decimal

Exhange rate

transactions[].displayRate

object

The display rate

transactions[].displayRate.base

string

Base currency

transactions[].displayRate.counter

string

Counter currency

transactions[].displayRate.rate

big decimal

Rate

Last updated