Download OpenAPI specification:Download
Welcome to CoinPayments API documentation!
IMPORTANT: This documentation is an extended version of CoinPayments public API definition and contains all the supported versions of the public API endpoints, specifically:
For the concise documentation with only most recent endpoint versions, please, see reduced CoinPayments API Documentation.
CoinPayments API is a RESTful JSON API for interacting with blockchains, accessed over HTTP or HTTPS from the domains https://api.coinpayments.com/api/v2/ and https://api.coinpayments.com/api/v1/. The present specification provides description of the latest versions of the most widely-used CoinPayments public API endpoints.
Coinpayments API docs defines a standard, language-agnostic interface to CoinPayments API. The platform allows merchants to integrate the payment system into their own websites or applications, allowing their customers to pay for goods or services with cryptocurrency. The API documentation provides the necessary information for developers to integrate the payment system into their own platforms, including details on how to authenticate requests, what parameters to include in requests and responses, and how to handle errors. Overall, the API is designed to provide a simple and secure way for merchants to accept cryptocurrency payments from their customers. In these docs you'll find everything you need to leverage CoinPayments for your applications.
Also, while studying documentation, you can test it in Postman. For this, you can download API collection here. For information on authentication with the Postman collection, please, visit this section.
To create test transactions, you can use LTCT coins. To claim LTCT, just click on the "Get Free LTCT" button next to the corresponding coin balance.
CoinPayments provides a multi-currency wallet that enables businesses and individuals to store, send, and receive a wide range of digital currencies and tokens. The free-to-set-up wallet is available on web and mobile, enabling account management online and on the go.
InternalReceive
- receiving funds within the system;UtxoExternalReceive
- receiving funds from external UTXO transfers;AccountBasedExternalReceive
- receiving funds from external account-based transfers;ExternalSpend
- sending funds to the address that does not belong to CoinPayments;InternalSpend
- sending funds from one CoinPayments user to another;SameUserSpend
- sending funds from one wallet to another for the same CoinPayments user;SameUserReceive
- receiving funds from one wallet to another for the same CoinPayments user;AccountBasedExternalTokenReceive
- receiving tokens from external account-based transfers;AccountBasedTokenSpend
- sending account-based tokens to external address;Conversion
- converting funds between user's wallets;AutoSweeping
- funds swept automatically to an external wallet by the auto-sweeping feature configured by the user;ReceiveTestFundsFromPool
- give out funding for testing;ReturnTestFundsToPool
- return test fund.In this section you will find ready-made code examples for the most frequent use-cases.
See examples of how to create invoices with CPS API:
If you’d rather skip sharing an invoice with the buyer and directly provide a payment address, check out this PHP example using the CPS v1 API. This example demonstrates how to generate an invoice with a cryptocurrency payment address all in one step, plus automatically create a QR code for seamless payment processing.
For more information on invoice white labeling see this section.
Learn how to create wallets with this PHP V1 API example.
Then see this example to learn how to send money between your wallets.
See our C# example of a webhook for a deposit transaction.
Also, see how to prove the authentication of the webhook received from CPS here.
Here you can find an example of how to check all the available webhook subscriptions for invoices and prove their authentication in PHP.
With this C# V1 API example you can learn how to check the conversion rate for a specific fiat amount to crypto.
See this C# V2 API example to learn how to check the current blockchain network fee for a particular cryptocurrency.
This section provides an overview of the common errors that you may encounter when utilizing CoinPayment API. By familiarizing yourself with these errors, you will be better equipped to handle potential issues and troubleshoot effectively. Understanding these errors will contribute to a smoother integration process and ensure a more seamless payment experience for your users.
This error occurs when an invalid clientId
or clientSecret
is used to generate API signature to authenticate requests. It may also occur if a clientId
is valid but the integration is either deleted or the user's account does not exist. or an invalid or incorrect client secret is provided. In such cases, the API returns an "Unauthorized" error.
This error can occur in different scenarios, such as during withdrawal to an external address or when converting a coin to another, whether to an internal or external address. It arises when the user's wallet does not have enough balance to cover the requested transaction amount.
When sending a request to create a withdrawal or a conversion, if the provided address is not valid or formatted incorrectly, this error is triggered. Users should double-check the address they provided and ensure it follows the required format. here are examples of Valid addresses
1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
bitcoincash:qr7uq7uvujmzhcv29tw92q0hs7fwpht4fvl4a4kj9a
LZx9pzGfH6mKSzVsJZnryeVrRzt6X8uZ9r
0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
0x6B175474E89094C44Da98b954EedeAC495271d0F
This error occurs when the requested invoice, withdrawal, conversion involves an invalid or unsupported currency. It could be due to the currency not being listed or supported on the platform. Users can utilize the currencies API included in the documentation to list all supported currencies and verify if their intended currency is supported before initiating the transaction.
This error occurs when there are issues with the validation of fields in the request's payload. For example, if a required field is not sent, or if the fields have invalid values or incorrect types. The API response for a validation error includes a description of the error and may provide details about the missing fields or the specific issues with the payload.
The API provides access to our platform's data and functionality, but in order to maintain the stability and performance of our services, rate limits have been implemented. Rate limits are set to prevent excessive use of the API and to ensure fair usage among all integrations. Currently, the rate limit is capped at a maximum of 70 requests per second.
CoinPayments API uses SHA-256 which is a way of authenticating an API request to ensure that it comes from a trusted source. In this scheme, the API server generates a unique signature for each request using the SHA-256 hashing algorithm.
Note: Currencies API, Rates API and Fees API endpoints do not require authorization.
To Integrate Coin Payments API you need to obtain CLIENT ID and CLIENT SECRET. If you have already created your credentials, you may skip to next section.
First, you need to create an account.
Then log into your account.
Warning It is strongly recommended that you save your credentials after they are shown to you. Your credentials will only be displayed once, and if you lose them, you will not be able to access the API. Please take the time to save your credentials in a secure location so that you can use them in the future.
In order to properly sign an authenticated request for the CoinPayments v2 API, the following headers must be included:
X-CoinPayments-Client
X-CoinPayments-Timestamp
X-CoinPayments-Signature
The following sections are instructions for properly populating these headers.
Populate this header with your clientId
.
Example value
cc7caaa431d54ad6accfd28b20170ee4
Before we Populate this header with the current time as a UNIX timestamp, exclude the milliseconds epoch, example:
const date = new Date().toISOString().split(".")[0];
Example value:
2022-12-19T19:27:04
To create an API signature, you first need to construct the query string which is made of the following attributes concatenated together
Example ( Javascript )
const queryString = `\ufeff${method}${url}${clientId}${date}${JSON.stringify(requestPayload)}`;
For requests with no request body, replace last attribute by an empty string: Example ( Javascript )
const queryString = `ufeff${method}${url}${clientId}${date}${''}`;
Next step is to use your clientSecret
to generate the signature using SHA-256 encryption algorithm as follows:
const hash = CryptoJS.HmacSHA256(queryString, CryptoJS.enc.Utf8.parse(clientSecret));
const signature = CryptoJS.enc.Base64.stringify(hash);
Example value:
oW7d1ktvK7R6741oACgVR3bysGTPY8tqren0WTmmEk0=
Here is a complete example of how to generate an API signature for making a call to the create wallet API:
const clientId = 'd0ccc52b8204460783d375e278082de2';
const clientSecret = 'WYEB+hN+89waO76QeO9T7IIqhdo/60GHrdYu2vEa7Tg=';
const url = `https://api.coinpayments.com/api/v1/merchant/wallets`;
const method = 'POST';
const date = new Date().toISOString().split('.')[0];
const createWalletDto = {
currencyId: 2,
label: 'Online Shop Wallet',
webhookUrl: 'https://mysite.com/api/v1/payment/notification',
};
const queryString = `\ufeff${method}${url}${clientId}${date}${JSON.stringify(createWalletDto)}`;
const hash = CryptoJS.HmacSHA256(queryString, CryptoJS.enc.Utf8.parse(clientSecret));
const signature = CryptoJS.enc.Base64.stringify(hash);
const headers = {
'X-CoinPayments-Client': clientId,
'X-CoinPayments-Timestamp': date,
'X-CoinPayments-Signature': signature,
};
/** Make API call using axios ( you may choose any http client ) */
const axiosoptions = {
url,
headers,
method,
data: createWalletDto,
};
const response = await this.httpsService.request(options).toPromise();
console.log(response);
When setting up authentication with Postman to test out our API collection, follow these steps:
baseUrl
.clientID
and clientSecret
from your API integration.const crypto = require('crypto-js')
const clientId = pm.environment.get('clientId')
const clientSecret = pm.environment.get('clientSecret')
const date = new Date().toISOString().split('.')[0];
const queryString = `\ufeff${pm.request.method}${pm.variables.replaceIn(pm.request.url.toString())}${clientId}${date}${pm.request.body}`;
const hash = CryptoJS.HmacSHA256(queryString, CryptoJS.enc.Utf8.parse(clientSecret));
const signature = CryptoJS.enc.Base64.stringify(hash);
pm.request.headers.add({
key: 'X-CoinPayments-Client',
value: clientId
})
pm.request.headers.add({
key: 'X-CoinPayments-Timestamp',
value: date
})
pm.request.headers.add({
key: 'X-CoinPayments-Signature',
value: signature
})
Request to create access level for merchant's admins
Create access to manage operations via API for merchant's admins
Success.
Not Authorized
Forbidden
{- "flags": "string"
}
In order to perform most API requests regarding payment/wallet management, the merchant has to provide a currency ID in the request. CoinPayments exposes currencies API endpoints allowing merchants to view the list of available cryptocurrencies in the system and learn about their details and capabilities.
Each currency supported by CoinPayments has a specific ID assigned to it. Besides, CoinPayments supports both native coins and tokens. In order to allow managing tokens of the same blockchain, CoinPayments API contains information on both - ID of the coin blockchain, where token belongs, and the smart contract address of the token. This information is returned in the format 'coinID:smartContract'. For example, if ID of ETH is "4", then for ERC20 USDT it would be "4:0xdac17f958d2ee523a2206206994597c13d831ec7".
Currency IDs are used for creating and listing merchant wallets. When creating a wallet, if only native currency ID is specified, the wallet is created for the same native currency. In case a wallet for the token is required, merchant must additionally indicate the token contract address when creating a wallet. See Create Wallet.
Also, currency IDs and contract addresses are used when creating transactions from a merchant wallet. For example, the body of the spend request specifically indicates the "toCurrency" ID and "from" and "to" contract addresses. This allows CoinPayments to indicate whether the said transaction is a regular withdrawal of funds or a transaction that additionally requires conversion. See Spend Request.
Below, you will find the detailed information on currency-related endpoints and their field values.
Returns a page of the supported currencies on the CoinPayments.com platform, by default ordered by their rank on CoinPayments.com.
Ok
Bad Request
[- {
- "id": "1",
- "type": "crypto",
- "symbol": "BTC",
- "name": "Bitcoin",
- "logo": {
- "iamgeUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "status": "active",
- "capabilities": "string",
- "requiredConfirmations": 0,
- "isEnabledForPayment": true
}
]
Returns a page of the supported currencies on the CoinPayments.com platform, by default ordered by their rank on CoinPayments.com.
Ok
Bad Request
[- {
- "id": "1",
- "type": "crypto",
- "symbol": "BTC",
- "name": "Bitcoin",
- "logo": {
- "iamgeUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "status": "active",
- "capabilities": "string",
- "requiredConfirmations": 0,
- "isEnabledForPayment": true
}
]
Get currency information by currency Id in the CoinPayments system
Success status code ( 200 )
currency not found
{- "id": "1",
- "type": "crypto",
- "symbol": "BTC",
- "name": "Bitcoin",
- "logo": {
- "iamgeUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "status": "active",
- "capabilities": "string",
- "requiredConfirmations": 0,
- "isEnabledForPayment": true
}
Get currency information by currency Id in the CoinPayments system
Success status code ( 200 )
currency not found
{- "id": "1",
- "type": "crypto",
- "symbol": "BTC",
- "name": "Bitcoin",
- "logo": {
- "iamgeUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "status": "active",
- "capabilities": "string",
- "requiredConfirmations": 0,
- "isEnabledForPayment": true
}
Get the latest blockchain block number by currency Id
Success status code ( 200 )
Bad request
{- "currencyId": "1",
- "latestBlockNumber": 773862
}
Get the latest blockchain block number by currency Id
Success status code ( 200 )
Bad request
{- "currencyId": "1",
- "latestBlockNumber": 773862
}
Get required confirmations for each currency.
Success status code ( 200 )
Bad request
[- {
- "currencyId": 1,
- "confirmationsCount": 0
}
]
Get required confirmations for each currency.
Success status code ( 200 )
Bad request
[- {
- "currencyId": "string",
- "currencySymbol": "string",
- "confirmationsCount": 0
}
]
Gets a list of all possible currency conversions
Success status code ( 200 )
Bad request
[- {
- "from": "4",
- "fromSymbol": "string",
- "to": "6",
- "toSymbol": "string"
}
]
Gets minimum and maximum amounts for a conversion pair in the "from" currency
Success status code ( 200 )
Bad request
{- "min": 462945000,
- "max": 6939885265000
}
Gets minimum and maximum amounts for a conversion pair in the "from" currency
Success status code ( 200 )
Bad request
{- "min": 462945000,
- "max": 6939885265000
}
Returns the currency conversion rates for the specified from currencies converted to the specified to currencies.
Success status code ( 200 )
Bad request
{- "items": [
- {
- "baseCurrencyId": 1,
- "baseToken": "string",
- "quoteCurrencyId": 0,
- "quoteToken": "string",
- "rate": "string"
}
]
}
Returns the currency conversion rates for the specified from currencies converted to the specified to currencies.
Success status code ( 200 )
Bad request
{- "items": [
- {
- "baseCurrencyId": "1",
- "baseSymbol": "string",
- "quoteCurrencyId": "string",
- "quoteSymbol": "string",
- "rate": "string"
}
]
}
Returns a currency supported on the CoinPayments.com platform with its current network fee on the blockchain.
Ok - blockchain fee for the currency in the smallest units
Unauthorized
Forbidden
Returns a currency supported on the CoinPayments.com platform with its current network fee on the blockchain.
Ok - blockchain fee for the currency
Unauthorized
Forbidden
CoinPayments provides merchants with the flexibility to create and manage wallets either through the user-friendly UI or via API calls. Due to security reasons, wallets created via UI cannot be managed via API. However, all wallets created via API are available through UI with the full functionality scope. Hence, in case merchant requires their funds from the wallet that was originally created via UI to be accessible via API, they need to sweep funds from the "UI wallet" to the "API wallet".
Since merchants may have several API clients activated, it is important to note that wallets created under one API client cannot be controlled by a different API client.
The Wallets API provides a set of endpoints that enable merchants to create new wallets with the coins supported by the platform, as well as initiate withdrawal requests from their wallets to any external or internal address of their choosing. With this powerful functionality, merchants have extensive control and flexibility in managing their cryptocurrency wallets to cater to their specific business needs.
Note: When sending funds to an address, make sure that the address you are sending to matches the token/coin that you credit to the address. Otherwise, this may lead to the funds being stuck in the network or even lost.
Addresses created via CoinPayments API are used as commercial addresses for commercial funds, e.g. gambler casino accounts. Hence, merchants require flexibility when accumulating and sweeping funds from such commercial addresses.
UTXO addresses, by their nature, allow for accumulation of funds and, hence, reduction of network fees when withdrawing funds in bulk from such addresses. Thus, it is possible to assign UTXO addresses to the merchant (and merchant can assign specific address to a specific customer) for permanent use without any considerable loss in service fees when managing funds. As a result, CoinPayments refers to UTXO addresses created via API as permanent addresses.
Account-based addresses created via CoinPayments API may be either temporary or permanent depending on the flag set up by the merchant when creating a new account-based address.
CoinPayments randomly emits temporary account-based address to a merchant so that the merchant could obtain a commercial deposit from a customer. The address stays in merchant's use for a certain period of time set up by the CoinPayments admins. When the time period expires, the address returns to the pool of CoinPayments addresses. This time period is renewed in case the address is topped up again before the set time period rus out. If the address returns to the pool, the funds are automatically assigned to the corresponding merchant API wallet within which the address had been emitted. Consolidation of funds from addresses at the main wallet balance is CoinPayments responsibility in this design and allows for reduction in fees when sweeping wallet balance elsewhere. Nevertheless, some merchants might find it uncomfortable that addresses cannot be assigned permanently to specific customers. Hence, customer must always check for the correct address before sending funds to the merchant.
The merchant can decide to use permanent account-based addresses if it is important to manage funds/balances
deposited by their customers individually. For that, when creating a commercial wallet via API, merchant must enable the
usePermanentAddresses
flag. Thus, all the addresses created within such wallet will be permanent. This will allow
merchant to assign specific addresses to specific clients perpetually. Such design allows for better customer experience.
Also, merchant can manage themselves when to sweep funds from addresses to the main UI wallet balance and further. Address
balance is always swept in full to reduce the amount of cases when a small amount of
funds is stuck on the address because the fee for withdrawal equals or higher than the withdrawn amount.
The tradeoff of the permanent address vs. temporary address design is fees. In order to be able to use the funds from permanent addresses, merchant must consolidate addresses balances at the UI wallet balance. For this each new address created within the API wallet must be activated. The activation fee is charged only once when the first withdrawal from the address takes place and the funds are swept from the address to the UI wallet balance. However, the network fee for further withdrawal of the consolidated funds is charged everytime funds are withdrawn from the wallet. Although address activation fees lead to larger expenses at the first sweep, each repetitive withdrawal of consolidated funds from the wallet is still way cheaper compared to regular withdrawal from an account-based address.
A common case for merchants is to use wallets and addresses created via API for receiving payments from their customers, e.g. top-up a subscription or casino account. A merchant can simplify the payment process for the buyer by incorporating payment details like payment amount, currency and payment address into a QR code. This will decrease the possibility of an error when sending funds.
For the QR code script example check description of the Payment Flow for Integrated Checkout with White Labeling in the Invoices API.
Unlike wallets and addresses created via UI, wallets and addresses created via API can send webhook notifications to the URL specified by the merchant. The URL for receiving webhook notifications is specified at wallet/address creation or update.
CoinPayments will send webhooks from one of these IPs:
hook1.coinpayments.com
- 23.183.244.249
hook2.coinpayments.com
- 23.183.244.250
All webhook messages from CoinPayments contain the same headers as used by merchants to sign requests to CoinPayments API:
const headers = {
'X-CoinPayments-Client': clientId,
'X-CoinPayments-Timestamp': date,
'X-CoinPayments-Signature': signature,
};
By verifying the signature with the help of the private key, merchant can make sure that the received webhook is produced by CoinPayments server.
The list of wallet/address transactions that support webhook notifications includes:
Below is an example of the webhook notification thrown when an external withdrawal is made from a wallet:
{
"walletId": "5ff25090-4f3a-4cc4-a187-59fce3f4e501",
"address": "miG63NqftkbxNYzHBkRQiZtdaE8xFsRSkr",
"transactionId": "407ee3f9-4d8d-4ebe-8b82-39704906f931",
"txHash": "c0581829ad6ccb1ba759799c00880917d16868aeba326781a4168fe32f961bdd",
"spendRequestId": "189466f2-8c29-4b8e-abe3-86eb3de79e2b",
"transactionType": "ExternalSpend",
"amount": "0.15019097",
"symbol": "LTCT",
"coinPaymentsFee": "0",
"coinPaymentsFeeSymbol": "LTCT",
"blockchainFee": "0.000013",
"blockchainFeeSymbol": "LTCT",
"totalAmount": "0.15020397",
"totalAmountSymbol": "LTCT",
"nativeAmount": "10.03",
"coinPaymentsFeeNativeAmount": "0",
"blockchainFeeNativeAmount": "0",
"totalNativeAmount": "10.03",
"nativeSymbol": "USD",
"confirmations": 3,
"requiredConfirmations": 3
}
Also, below is the description of the typical wallet transaction webhook payload.
All webhooks sent by CPs API contain information on the wallet transaction type and information on the amount deposited. Below is the payload of the webhooks sent from CPs API to your server API.
Success status code ( 200 )
CoinPayments API could not reach your server
{- "walletId": "4ca18e8e-915b-4a69-a17a-0b0b666858a7",
- "address": "myGTmrMtU6vUULkYRCDxJMggF7egsXhcTi",
- "transactionId": "cb44e78f-a97b-44b5-a23d-1e3b025aab47",
- "txHash": "9d9dd1f6f4a62388797e6beeb76c1a3c34d41942303ce6fb49177d3c88a74d11",
- "spendRequestId": "448c1624-98e7-43c9-85f4-75ed0c97a8bb",
- "transactionType": "ExternalSpend",
- "amount": 0,
- "symbol": "string",
- "coinPaymentsFee": 0,
- "coinPaymentsFeeSymbol": "string",
- "blockchainFee": "string",
- "blockchainFeeSymbol": "string",
- "totalAmount": "string",
- "totalAmountSymbol": "string",
- "nativeAmount": 0,
- "coinPaymentsFeeNativeAmount": "string",
- "blockchainFeeNativeAmount": "string",
- "totalNativeAmount": "string",
- "nativeSymbol": "string",
- "confirmations": 0,
- "requiredConfirmations": 0
}
All webhooks sent by CPs API contain information on the wallet transaction type and information on the amount deposited. Below is the payload of the webhooks sent from CPs API to your server API.
Success status code ( 200 )
CoinPayments API could not reach your server
{- "walletId": "4ca18e8e-915b-4a69-a17a-0b0b666858a7",
- "address": "myGTmrMtU6vUULkYRCDxJMggF7egsXhcTi",
- "transactionId": "cb44e78f-a97b-44b5-a23d-1e3b025aab47",
- "txHash": "9d9dd1f6f4a62388797e6beeb76c1a3c34d41942303ce6fb49177d3c88a74d11",
- "spendRequestId": "448c1624-98e7-43c9-85f4-75ed0c97a8bb",
- "transactionType": "ExternalSpend",
- "amount": 0,
- "symbol": "string",
- "coinPaymentsFee": 0,
- "coinPaymentsFeeSymbol": "string",
- "blockchainFee": "string",
- "blockchainFeeSymbol": "string",
- "totalAmount": "string",
- "totalAmountSymbol": "string",
- "nativeAmount": 0,
- "coinPaymentsFeeNativeAmount": "string",
- "blockchainFeeNativeAmount": "string",
- "totalNativeAmount": "string",
- "nativeSymbol": "string",
- "confirmations": 0,
- "requiredConfirmations": 0
}
Creates new wallet by currency Id. Note: you can get the currency Id from the Сurrencies API.
Create wallet payload
Success
Currency Not Found!
{- "currencyId": "4:0x152649ea73beab28c5b49b26eb48f7ead6d4c898",
- "label": "John's wallet",
- "contractAddress": "string",
- "usePermanentAddresses": true
}
{- "walletId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "address": "LaN1Vy2FugxWiAyMc8ipKe6Hcnh3mcKuym"
}
Retrieves a list of wallets with their balances, addresses, statuses and other info.
OK
Wallet not found
[- {
- "walletId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "walletType": [
- "singleSigCryptoWallet"
], - "currencyId": 1,
- "isActive": true,
- "isLocked": true,
- "label": "John's wallet",
- "depositAddress": "0x9939b7b208012cd0395d1411272be6e34c04af7b",
- "confirmedBalance": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "unconfirmedBalance": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "unconfirmedNativeBalance": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "confirmedNativeBalance": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "confirmedTokens": [
- {
- "contractAddress": "string",
- "nativeValue": "string",
- "nativeCurrencyId": 0,
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": "string"
}
], - "unconfirmedTokens": [
- {
- "contractAddress": "string",
- "nativeValue": "string",
- "nativeCurrencyId": 0,
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": "string"
}
], - "canCreateAddress": true,
- "isVaultLocked": true,
- "vaultLockoutEndDateTime": "2023-07-04T22:21:41.535Z",
- "contractAddress": "string",
- "hasPermanentAddresses": true,
- "hasActiveAddress": true,
- "clientId": "string"
}
]
Creates new wallet by currency Id. Note: you can get the currency Id from the Сurrencies API.
Create wallet payload
Success
Unauthorized
Forbidden
{- "currency": "4:0x152649ea73beab28c5b49b26eb48f7ead6d4c898",
- "label": "John's wallet",
- "usePermanentAddresses": true
}
{- "walletId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "address": "LaN1Vy2FugxWiAyMc8ipKe6Hcnh3mcKuym"
}
Retrieves a list of wallets with their balances, addresses, statuses and other info.
OK
Wallet not found
[- {
- "walletId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "walletType": [
- "singleSigCryptoWallet"
], - "currencyId": 1,
- "isActive": true,
- "isLocked": true,
- "label": "John's wallet",
- "depositAddress": "0x9939b7b208012cd0395d1411272be6e34c04af7b",
- "confirmedBalance": {
- "value": "string",
- "currencyId": "string",
- "currencySymbol": "string"
}, - "unconfirmedBalance": {
- "value": "string",
- "currencyId": "string",
- "currencySymbol": "string"
}, - "confirmedNativeBalance": {
- "value": "string",
- "currencyId": "string",
- "currencySymbol": "string"
}, - "unconfirmedNativeBalance": {
- "value": "string",
- "currencyId": "string",
- "currencySymbol": "string"
}, - "canCreateAddress": true,
- "isVaultLocked": true,
- "vaultLockoutEndDateTime": "2023-07-04T22:21:41.535Z",
- "hasPermanentAddresses": true,
- "hasActiveAddress": true,
- "clientId": "string"
}
]
{- "walletId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "walletType": [
- "singleSigCryptoWallet"
], - "currencyId": 1,
- "isActive": true,
- "isLocked": true,
- "label": "John's wallet",
- "depositAddress": "0x9939b7b208012cd0395d1411272be6e34c04af7b",
- "confirmedBalance": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "unconfirmedBalance": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "unconfirmedNativeBalance": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "confirmedNativeBalance": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "confirmedTokens": [
- {
- "contractAddress": "string",
- "nativeValue": "string",
- "nativeCurrencyId": 0,
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": "string"
}
], - "unconfirmedTokens": [
- {
- "contractAddress": "string",
- "nativeValue": "string",
- "nativeCurrencyId": 0,
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": "string"
}
], - "canCreateAddress": true,
- "isVaultLocked": true,
- "vaultLockoutEndDateTime": "2023-07-04T22:21:41.535Z",
- "contractAddress": "string",
- "hasPermanentAddresses": true,
- "hasActiveAddress": true,
- "clientId": "string"
}
{- "walletId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "walletType": [
- "singleSigCryptoWallet"
], - "currencyId": 1,
- "isActive": true,
- "isLocked": true,
- "label": "John's wallet",
- "depositAddress": "0x9939b7b208012cd0395d1411272be6e34c04af7b",
- "confirmedBalance": {
- "value": "string",
- "currencyId": "string",
- "currencySymbol": "string"
}, - "unconfirmedBalance": {
- "value": "string",
- "currencyId": "string",
- "currencySymbol": "string"
}, - "confirmedNativeBalance": {
- "value": "string",
- "currencyId": "string",
- "currencySymbol": "string"
}, - "unconfirmedNativeBalance": {
- "value": "string",
- "currencyId": "string",
- "currencySymbol": "string"
}, - "canCreateAddress": true,
- "isVaultLocked": true,
- "vaultLockoutEndDateTime": "2023-07-04T22:21:41.535Z",
- "hasPermanentAddresses": true,
- "hasActiveAddress": true,
- "clientId": "string"
}
Allows to update Url used to receiving webhooks for wallet transactions
Success
Unauthorized
Forbidden
{- "notificationUrl": "string"
}
Allows to update Url used to receiving webhooks for wallet transactions
Success
Unauthorized
Forbidden
{- "notificationUrl": "string"
}
This endpoint creates a new address under the wallet with the specified ID. The walletIdStr parameter is a required path parameter that identifies the target wallet. The request body is optional, but if included, it can contain a label field to provide a label for the new address. The response to a successful request returns a 201 Created status code and an object containing the address and the address ID.
Success
Unauthorized
Forbidden
{- "label": "shop tests address",
- "notificationUrl": "string"
}
{- "addressId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "networkAddress": "LNUPQLeQFfF67RtH1dqFBiwJhYBNZCW7pm",
- "rentedTill": "2024-08-14T16:48:38"
}
Retrieves a list of wallet addresses
OK
Wallet not found
[- {
- "addressId": "string",
- "label": "string",
- "address": "string",
- "notificationUrl": "string",
- "rentedTill": "string"
}
]
This endpoint creates a new address under the wallet with the specified ID. The walletIdStr parameter is a required path parameter that identifies the target wallet. The request body is optional, but if included, it can contain a label field to provide a label for the new address. The response to a successful request returns a 201 Created status code and an object containing the address and the address ID.
Success
Unauthorized
Forbidden
{- "label": "shop tests address",
- "notificationUrl": "string"
}
{- "addressId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "networkAddress": "LNUPQLeQFfF67RtH1dqFBiwJhYBNZCW7pm",
- "rentedTill": "2024-08-14T16:48:38"
}
Retrieves a list of wallet addresses
OK
Wallet not found
[- {
- "addressId": "string",
- "label": "string",
- "address": "string",
- "notificationUrl": "string",
- "rentedTill": "string"
}
]
Retrieves address by wallet and address Ids
OK
Unauthorized
Forbidden
{- "addressId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "label": "string",
- "address": "string",
- "notificationUrl": "string",
- "rentedTill": "string"
}
Retrieves address by wallet and address Ids
OK
Unauthorized
Forbidden
{- "addressId": "0a54b29f-51cb-44a8-9bed-111c5cb1b335",
- "label": "string",
- "address": "string",
- "notificationUrl": "string",
- "rentedTill": "string"
}
Allows to update Url used to receiving webhooks for address transactions
Update address webhook Url
Success
Unauthorized
Forbidden
{- "notificationUrl": "string"
}
Allows to update Url used to receiving webhooks for address transactions
Update address webhook Url
Success
Unauthorized
Forbidden
{- "notificationUrl": "string"
}
Retrieves a list of all wallet transactions
Ok
Unauthorized
Forbidden
[- {
- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "dateCreated": "2022-10-05T08:39:41.494Z",
- "dateCompleted": "2022-10-05T08:40:41.494Z",
- "fromOwnerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "fromWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "toWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "spendRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "fromCurrencyId": 1,
- "toCurrencyId": 2,
- "fromAmount": "0.22390234",
- "toAmount": "0.13448434",
- "coinpaymentsFee": "0.000012",
- "transactionStatus": "created",
- "transactionType": "externalSpend",
- "memo": "July rent",
- "fromAddress": "1AYASDI34W2W2SIFFRE32452S1Q",
- "toAddress": "1AYASDI34W2W2SIFFRE32452S1Q",
- "txHash": "1AYASDI34W2W2SIFFRE32452S1Q3289y7debugDSDSd38d3xSSA33ASDRxw98",
- "outputIndex": 1,
- "blockchainFee": "0.00000032",
- "fromContractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "toContractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "blockchainFeeCurrency": "string",
- "coinPaymentsFeeCurrency": "string",
- "blockNumberTxAppearedAt": "string",
- "supportTransactionId": "string",
- "confirmations": 2,
- "requiredConfirmations": 5,
- "fromAmountNative": "string",
- "toAmountNative": "string",
- "coinpaymentsFeeNative": "string",
- "blockchainFeeNative": "string",
- "isInvoicePaymentSend": true,
- "paymentType": "string",
- "convertedTxHash": "string"
}
]
Retrieves a list of all wallet transactions
Ok
Unauthorized
Forbidden
[- {
- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "dateCreated": "2022-10-05T08:39:41.494Z",
- "dateCompleted": "2022-10-05T08:40:41.494Z",
- "fromOwnerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "fromWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "toWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "spendRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "fromCurrencyId": "1",
- "fromCurrencySymbol": "string",
- "toCurrencyId": "2",
- "toCurrencySymbol": "string",
- "fromAmount": "0.22390234",
- "toAmount": "0.13448434",
- "coinpaymentsFee": "0.000012",
- "coinPaymentsFeeCurrency": "string",
- "coinPaymentsFeeCurrencySymbol": "string",
- "blockchainFee": "0.00000032",
- "blockchainFeeCurrency": "string",
- "blockchainFeeCurrencySymbol": "string",
- "transactionStatus": "created",
- "transactionType": "externalSpend",
- "memo": "July rent",
- "fromAddress": "1AYASDI34W2W2SIFFRE32452S1Q",
- "toAddress": "1AYASDI34W2W2SIFFRE32452S1Q",
- "txHash": "1AYASDI34W2W2SIFFRE32452S1Q3289y7debugDSDSd38d3xSSA33ASDRxw98",
- "outputIndex": 1,
- "blockNumberTxAppearedAt": 0,
- "supportTransactionId": "string",
- "confirmations": 2,
- "requiredConfirmations": 5,
- "fromAmountNative": "string",
- "toAmountNative": "string",
- "coinpaymentsFeeNative": "string",
- "blockchainFeeNative": "string",
- "nativeCurrency": "string",
- "nativeCurrencySymbol": "string",
- "isInvoicePaymentSend": true,
- "paymentType": "string",
- "convertedTxHash": "string"
}
]
Get a specific transaction of a wallet. This request requires the walletIdStr URL parameter. Additionally, there are two optional query parameters: transactionId and spendRequestId. For a valid request at least one of these parameters must be specified. If both transactionId and spendRequestId are specified, transactionId takes precedence. If only spendRequestId is provided, the first transaction that matches the spendRequestId will be returned.
Ok
Wallet not found
{- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "dateCreated": "2022-10-05T08:39:41.494Z",
- "dateCompleted": "2022-10-05T08:40:41.494Z",
- "fromOwnerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "fromWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "toWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "spendRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "fromCurrencyId": 1,
- "toCurrencyId": 2,
- "fromAmount": "0.22390234",
- "toAmount": "0.13448434",
- "coinpaymentsFee": "0.000012",
- "transactionStatus": "created",
- "transactionType": "externalSpend",
- "memo": "July rent",
- "fromAddress": "1AYASDI34W2W2SIFFRE32452S1Q",
- "toAddress": "1AYASDI34W2W2SIFFRE32452S1Q",
- "txHash": "1AYASDI34W2W2SIFFRE32452S1Q3289y7debugDSDSd38d3xSSA33ASDRxw98",
- "outputIndex": 1,
- "blockchainFee": "0.00000032",
- "fromContractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "toContractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "blockchainFeeCurrency": "string",
- "coinPaymentsFeeCurrency": "string",
- "blockNumberTxAppearedAt": "string",
- "supportTransactionId": "string",
- "confirmations": 2,
- "requiredConfirmations": 5,
- "fromAmountNative": "string",
- "toAmountNative": "string",
- "coinpaymentsFeeNative": "string",
- "blockchainFeeNative": "string",
- "isInvoicePaymentSend": true,
- "paymentType": "string",
- "convertedTxHash": "string"
}
Get a specific transaction of a wallet. This request requires the walletIdStr URL parameter. Additionally, there are two optional query parameters: transactionId and spendRequestId. For a valid request at least one of these parameters must be specified. If both transactionId and spendRequestId are specified, transactionId takes precedence. If only spendRequestId is provided, the first transaction that matches the spendRequestId will be returned.
Ok
Wallet not found
{- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "dateCreated": "2022-10-05T08:39:41.494Z",
- "dateCompleted": "2022-10-05T08:40:41.494Z",
- "fromOwnerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "fromWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "toWalletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "spendRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "fromCurrencyId": "1",
- "fromCurrencySymbol": "string",
- "toCurrencyId": "2",
- "toCurrencySymbol": "string",
- "fromAmount": "0.22390234",
- "toAmount": "0.13448434",
- "coinpaymentsFee": "0.000012",
- "coinPaymentsFeeCurrency": "string",
- "coinPaymentsFeeCurrencySymbol": "string",
- "blockchainFee": "0.00000032",
- "blockchainFeeCurrency": "string",
- "blockchainFeeCurrencySymbol": "string",
- "transactionStatus": "created",
- "transactionType": "externalSpend",
- "memo": "July rent",
- "fromAddress": "1AYASDI34W2W2SIFFRE32452S1Q",
- "toAddress": "1AYASDI34W2W2SIFFRE32452S1Q",
- "txHash": "1AYASDI34W2W2SIFFRE32452S1Q3289y7debugDSDSd38d3xSSA33ASDRxw98",
- "outputIndex": 1,
- "blockNumberTxAppearedAt": 0,
- "supportTransactionId": "string",
- "confirmations": 2,
- "requiredConfirmations": 5,
- "fromAmountNative": "string",
- "toAmountNative": "string",
- "coinpaymentsFeeNative": "string",
- "blockchainFeeNative": "string",
- "nativeCurrency": "string",
- "nativeCurrencySymbol": "string",
- "isInvoicePaymentSend": true,
- "paymentType": "string",
- "convertedTxHash": "string"
}
This endpoint executes the sweep of the balances from all selected addresses of the wallet to the main wallet balance. The endpoint is applied only for account-based currency wallets that contain permanent addresses.
Success
Unauthorized
Forbidden
{- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "addresses": [
- {
- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "address": "string",
- "addressId": "string"
}
]
}
This endpoint executes the sweep of the balances from all selected addresses of the wallet to the main wallet balance. The endpoint is applied only for account-based currency wallets that contain permanent addresses.
Success
Unauthorized
Forbidden
{- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "addresses": [
- {
- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "address": "string",
- "addressId": "string"
}
]
}
This endpoint displays details of the possible sweep from the balances of all available wallet addresses to the main wallet balance. The endpoint is applied only for account-based currency wallets that contain permanent addresses. By using this endpoint merchant can decide from which addresses to make a sweep.
OK
Unauthorized
Forbidden
{- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "addresses": [
- {
- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "address": "string",
- "addressId": "string"
}
]
}
This endpoint displays details of the possible sweep from the balances of all available wallet addresses to the main wallet balance. The endpoint is applied only for account-based currency wallets that contain permanent addresses. By using this endpoint merchant can decide from which addresses to make a sweep.
OK
Unauthorized
Forbidden
{- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "addresses": [
- {
- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "address": "string",
- "addressId": "string"
}
]
}
This endpoint provides the preview of the planned sweep of the balances from all selected addresses of all available merchant wallets in one currency to the main wallet balance. The endpoint is applied only for account-based currency wallets that contain permanent addresses.
Create wallets consolidation preview
Array of objects list of wallets with their addresses for which consolidation is executed |
Success
Unauthorized
Forbidden
{- "wallets": [
- {
- "walletId": "string",
- "addresses": [
- "3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}
]
}
{- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "addresses": [
- {
- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "address": "string",
- "addressId": "string",
- "walletId": "string"
}
]
}
This endpoint provides the preview of the planned sweep of the balances from all selected addresses of all available merchant wallets in one currency to the main wallet balance. The endpoint is applied only for account-based currency wallets that contain permanent addresses.
Create wallets consolidation preview
Array of objects list of wallets with their addresses for which consolidation is executed |
Success
Unauthorized
Forbidden
{- "wallets": [
- {
- "walletId": "string",
- "addresses": [
- "3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}
]
}
{- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "addresses": [
- {
- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "address": "string",
- "addressId": "string",
- "walletId": "string"
}
]
}
This endpoint executes the sweep of the balances from all selected addresses of all available merchant wallets in one currency to the main wallet balance. The endpoint is applied only for account-based currency wallets that contain permanent addresses.
Success
Unauthorized
Forbidden
{- "wallets": [
- {
- "walletId": "string",
- "addresses": [
- "3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}
]
}
{- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "addresses": [
- {
- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "address": "string",
- "addressId": "string",
- "walletId": "string"
}
]
}
This endpoint executes the sweep of the balances from all selected addresses of all available merchant wallets in one currency to the main wallet balance. The endpoint is applied only for account-based currency wallets that contain permanent addresses.
Success
Unauthorized
Forbidden
{- "wallets": [
- {
- "walletId": "string",
- "addresses": [
- "3fa85f64-5717-4562-b3fc-2c963f66afa6"
]
}
]
}
{- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "addresses": [
- {
- "newReceivedInternal": "string",
- "newReceivedExternal": "string",
- "activationFee": "string",
- "transferFee": "string",
- "totalFee": "string",
- "available": "string",
- "address": "string",
- "addressId": "string",
- "walletId": "string"
}
]
}
The Spend Request API allows users to initiate a withdrawal or a conversion transaction, both features follow a two-step process:
1- Send spend request: This request will trigger a response containing a preview of the transaction, including any applicable fees. The purpose of this step is to allow users to review and verify the information provided, including the amount and any associated fees before proceeding.
2- Confirm spending funds: the confirm spending funds endpoint is used to confirm spending funds from the merchant wallet, or to confirm converting funds. It is used to trigger publishing the transaction on the blockchain.
Note: The "spendRequestId", used to confirm spending funds, is available in the response from the first step.
Here's a simplified flowchart explaining the withdrawal/conversion flow:
Withdrawal Request payload
Ok
Unauthorized
Forbidden
{- "toAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "toCurrencyId": 6,
- "fromContractAddress": "0xB8c77482e45F1F44dE1745F52C74426C631bDD52",
- "toContractAddress": "0xB8c77482e45F1F44dE1745F52C74426C631bDD52",
- "amountInSmallestUnits": "9900000",
- "blockchainFeeOverrideInSmallestUnits": "0.0003234",
- "memo": "string",
- "receiverPaysFee": false,
- "walletToPayFeeFrom": "string"
}
{- "spendRequestId": "02741e6d-f5c5-43bb-8f08-9a523173cb42",
- "fromWalletId": "e0ac29cd-d2d2-4f27-8196-236fc75a1e31",
- "toAddress": "mmbYp8ziTBXxPJKM7ai74poX33fPqxwMWK",
- "fromContractAddress": "string",
- "fromCurrencyId": 1002,
- "toCurrencyId": 1002,
- "blockchainFee": 0.0001,
- "coinpaymentsFee": 0.0001,
- "fromAmount": 2,
- "toAmount": 2,
- "memo": "This is a memo",
- "toContractAddress": "string",
- "walletToPayFeeFrom": "string"
}
The Spend Request API allows users to initiate a withdrawal or a conversion transaction, both features follow a two-step process:
1- Send spend request: This request will trigger a response containing a preview of the transaction, including any applicable fees. The purpose of this step is to allow users to review and verify the information provided, including the amount and any associated fees before proceeding.
2- Confirm spending funds: the confirm spending funds endpoint is used to confirm spending funds from the merchant wallet, or to confirm converting funds. It is used to trigger publishing the transaction on the blockchain.
Note: The "spendRequestId", used to confirm spending funds, is available in the response from the first step.
Here's a simplified flowchart explaining the withdrawal/conversion flow:
Withdrawal Request payload
Ok
Unauthorized
Forbidden
{- "toAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "toCurrency": "6",
- "amount": "9900000",
- "blockchainFeeOverride": "0.0003234",
- "memo": "string",
- "receiverPaysFee": false,
- "walletToPayFeeFrom": "string"
}
{- "spendRequestId": "02741e6d-f5c5-43bb-8f08-9a523173cb42",
- "fromWalletId": "e0ac29cd-d2d2-4f27-8196-236fc75a1e31",
- "toAddress": "mmbYp8ziTBXxPJKM7ai74poX33fPqxwMWK",
- "fromCurrencyId": "1002",
- "fromCurrencySymbol": "string",
- "fromAmount": "2",
- "toCurrencyId": "1002",
- "toCurrencySymbol": "string",
- "toAmount": "2",
- "blockchainFee": "0.0001",
- "coinpaymentsFee": "0.0001",
- "memo": "This is a memo",
- "walletToPayFeeFrom": "string"
}
Send a request to confirm the withdrawal or conversion
Success
Spend request not found or expired
{- "spendRequestId": "string"
}
{- "title": "string",
- "status": 400,
- "detail": "string",
- "instance": "string"
}
Send a request to confirm the withdrawal or conversion
Success
Spend request not found or expired
{- "spendRequestId": "string"
}
{- "title": "string",
- "status": 400,
- "detail": "string",
- "instance": "string"
}
CoinPayments exposes invoices API endpoints allowing merchants to implement a payment gateway on their platform, and let buyers pay for goods and services in a wide selection of cryptocurrencies.
With CoinPayments invoices API you may:
Below you will find information on how payment flow is organized for each of the above-mentioned approaches.
Let us consider a subscription use case, where you have a platform that provides services with a subscription payment model. Every month you need to send out invoices to your users with the reminder to pay for the subscription and ability to collect this payment in crypto. In order to automate this flow, you may want to use CoinPayments API. Here are the steps that should take place in order for a payment to occur:
Note: In order this request could work properly, merchant must make sure to eliminate the following attribute from the request:
"payment": {
"paymentCurrency": "4:0xdac17f958d2ee523a2206206994597c13d831ec7"
"refundEmail": "jane_doe@hotmail.com"
}
Providing the 'refundEmail' and 'paymentCurrency' will initiate the White Labeling flow disclosed below. Leaving 'payment' attribute empty will cause an error.
Let us consider a case where you have an online shop and you want to accept payment for goods in cryptocurrency. With CoinPayments API you will be able to allow buyers to request goods and pay with the cryptocurrency all at your website and under your own branding. Here are the steps that should take place in order payment could occur:
{
...
"Payment": {
"RefundEmail": "jane_doe@hotmail.com"
}
}
At the same time, the 'createInvoice' endpoint generates an invoice entity including:
3.a. A merchant can combine steps 2 and 3 into one, i.e. create an invoice for the shopping cart content already with the payment in the specific cryptocurrency. For this, when creating invoice, merchant should provide id of the 'PaymentCurrency' in the 'Payment' entity of the 'CreateInvoice' request:
{
...
"Payment": {
"RefundEmail": "jane_doe@hotmail.com",
"PaymentCurrency": "4:0xdac17f958d2ee523a2206206994597c13d831ec7"
}
}
The indication of the cryptocurrency id will trigger creation of the invoice together with payment and HotWallet (address for buyer). In the createInvoice response the merchant will receive a link to the CoinPayments checkout app:
{
"invoices": [
{
...
"checkoutLink": "https://checkout.coinpayments.com/checkout/?invoice-id=56284ebf-8daf-4eed-a3a4-00a3ba255788",
...
}
]
}
By providing the link to the buyer, she will get directly to the checkout page with the payment address, QR code and timer for payment.
A merchant can simplify the payment process for the buyer by incorporating payment details like payment amount, currency and payment address into a QR code. Below is an example of a script to create a QR code:
<div id="canvas"></div>
<script type="text/javascript" src="https://unpkg.com/qr-code-styling@1.5.0/lib/qr-code-styling.js"></script>
<script type="text/javascript">
const generateQRData = (currency, address, tag, amount) => {
switch (currency.name) {
case 'Bitcurrency SV':
return `bitcurrency:${address}?sv&amount=${amount}`;
case 'Tether USD (Omni)':
return `bitcurrency:${address}?amount=${amount}&req-asset=${currency.id}`;
case 'BinanceCoin':
return `bnb:${address}?sv&amount=${amount}&req-asset=${currency.id}`;
case 'Tether USD (ERC20)':
return `ethereum:${address}?value=${amount}&req-asset=${currency.id.slice(currency.id.indexOf(':') + 1)}`;
case 'Tether USD (TRC20)':
return `tron:${address}?value=${amount}&req-asset=${currency.id.slice(currency.id.indexOf(':') + 1)}`;
default:
return `${currency?.name?.toLowerCase().replace(/ /g, '')}:${address}?amount=${amount}${tag ? `&tag=${tag}` : ''}`;
}
};
const color = "#2A5ED5";
const corner = "#000000";
const margin = 5;
const qrCode = new QRCodeStyling({
width: 200,
height: 200,
dotsOptions: {
color: color,
type: "square"
},
backgroundOptions: {
color: "transparent",
gradient: null
},
cornersSquareOptions: {
type: "square",
color: corner
},
cornersDotOptions: {
type: "square",
color: corner
},
imageOptions: {
crossOrigin: "anonymous",
imageSize: 0.5,
margin: margin
}
});
qrCode.append(document.querySelector('#canvas'));
qrCode.update({
data: generateQRData(currency, address, tag, amount)
});
</script>
Let us consider another case for an online shop where you want to accept payment for goods in cryptocurrency and want to allow your buyers to make quick purchases by clicking on the Buy-Now button next to the good or service you offer. With CoinPayments API you will be able to allow buyers to request goods and pay with the cryptocurrency in a matter of a few clicks. Here are the steps that should take place in order payment could occur:
Funds that merchants receive via payments are primarily deposited to the CoinPayments system balance. From there, CoinPayments conducts payouts to the merchant's balance. CoinPayments UI provides the merchant with a possibility to set up mode and frequency for paying out funds from CoinPayments balance to the merchant's own balance. The settings are set up by currency.
Below, you will find the detailed information on each of the invoices endpoints and their field values. Endpoints are the same for both described use-cases with the slight difference in utilizing certain fields in schemas. All such differences will be outlined explicitly.
Request to create an invoice, which is a list of goods or services with a statement of the sum due provided by the merchant, that a buyer intends to purchase
Create Invoice
Success. Invoice in all available currencies. Note, for Invoice Links flow, only "id" and "link" properties are necessary
Not Authorized
Forbidden
{- "isEmailDelivery": false,
- "emailDelivery": {
- "to": "string",
- "cc": "string",
- "bcc": "string"
}, - "dueDate": "2023-04-26T18:40:41.322Z",
- "invoiceDate": "2022-11-28T13:59:46+00:00",
- "draft": false,
- "clientId": "string",
- "invoiceId": false,
- "buyer": {
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}
}, - "description": "string",
- "shipping": {
- "method": "string",
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}
}, - "requireBuyerNameAndEmail": true,
- "buyerDataCollectionMessage": "string",
- "notes": "string",
- "notesToRecipient": "string",
- "termsAndConditions": "string",
- "merchantOptions": {
- "showAddress": false,
- "showPhone": false,
- "showRegistrationNumber": false,
- "showEmail": false,
- "additionalInfo": "string"
}, - "customData": { },
- "metadata": {
- "integration": "string",
- "hostname": "string"
}, - "poNumber": "string",
- "webhooks": [
- {
- "notifications": [
- "invoiceCreated",
- "invoicePending",
- "invoicePaid",
- "invoiceCompleted",
- "invoiceCancelled",
- "invoiceTimedOut"
]
}
], - "payoutConfig": {
- "currencyId": "string",
- "contractAddress": "string",
- "address": "string",
- "frequency": [
- "normal",
- "asSoonAsPossible",
- "hourly",
- "nightly",
- "weekly"
]
}, - "payment": {
- "paymentCurrency": "string",
- "refundEmail": "string"
}, - "items": [
- {
- "customId": "string",
- "sku": "string",
- "name": "Iphone 22",
- "description": "string",
- "quantity": {
- "value": 0,
- "type": "1"
}, - "originalAmount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "amount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "tax": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}
}
], - "amount": {
- "breakdown": {
- "subtotal": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "shipping": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "taxTotal": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "discount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}
}, - "currencyId": "string",
- "contractAddress": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": "string"
}, - "hideShoppingCart": true
}
{- "invoices": [
- {
- "id": "string",
- "link": "string",
- "checkoutLink": "string",
- "payment": {
- "paymentId": "string",
- "expires": "2023-09-02T08:06:26+00:00",
- "paymentCurrencies": [
- {
- "currency": {
- "id": "string",
- "type": [ ],
- "symbol": "string",
- "name": "string",
- "logo": "string",
- "decimalPlaces": 0,
- "rank": 0,
- "status": "string",
- "capabilities": "string",
- "urls": {
- "websites": [ ],
- "explorers": [ ]
}, - "requiredConfirmations": 0,
- "isEnabledForPayment": true
}, - "isDisabled": true,
- "amount": {
- "rate": "string",
- "breakdown": [
- { }
], - "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "nativePreferredAmount": {
- "rate": "string",
- "breakdown": [
- { }
], - "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "approximateNetworkAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "approximateNetworkInNativeCurrencyAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "remainingAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}
], - "refundEmail": "string"
}, - "hotWallet": {
- "currency": {
- "id": "1",
- "type": "crypto",
- "symbol": "BTC",
- "name": "Bitcoin",
- "logo": {
- "iamgeUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "status": "active",
- "capabilities": "string",
- "requiredConfirmations": 0,
- "isEnabledForPayment": true
}, - "amount": {
- "rate": "string",
- "breakdown": [
- {
- "name": "string",
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
], - "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "addresses": {
- "address": "string",
- "biP21": "string"
}, - "expires": "string",
- "remainingAmount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}
}
}
]
}
Get list of merchant invoices
Success
Merchant Not Found!
[- {
- "items": [
- {
- "id": "string",
- "invoiceId": "string",
- "invoiceIdSuffix": "string",
- "created": "string",
- "invoiceDate": "string",
- "dueDate": "string",
- "confirmed": "string",
- "completed": "string",
- "cancelled": "string",
- "currency": {
- "id": "string",
- "symbol": "string",
- "name": "string",
- "token": {
- "name": "string",
- "symbol": "string",
- "contractAddress": "string",
- "decimalPlaces": 0
}, - "logo": {
- "imageUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0
}, - "buyer": {
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}, - "hasData": true
}, - "description": "string",
- "amount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "shipping": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}, - "status": "string",
- "metadata": {
- "integration": "string"
}, - "payments": [
- {
- "expectedAmount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "nativeExpectedAmount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "actualAmount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "nativeActualAmount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "paymentAddress": "string",
- "errorCode": "string",
- "fees": {
- "paymentSubTotal": {
- "currencySymbol": null,
- "currencyId": null,
- "displayValue": null,
- "value": null,
- "valueAsDecimal": null
}, - "merchantMarkupOrDiscount": {
- "currencySymbol": null,
- "currencyId": null,
- "displayValue": null,
- "value": null,
- "valueAsDecimal": null
}, - "buyerFee": {
- "coinPaymentsFee": null,
- "networkFee": null,
- "conversionFee": null,
- "total": null
}, - "merchantFee": {
- "coinPaymentsFee": null,
- "networkFee": null,
- "conversionFee": null,
- "total": null
}, - "gross": 0
}, - "nativeFees": {
- "paymentSubTotal": {
- "currencySymbol": null,
- "currencyId": null,
- "displayValue": null,
- "value": null,
- "valueAsDecimal": null
}, - "merchantMarkupOrDiscount": {
- "currencySymbol": null,
- "currencyId": null,
- "displayValue": null,
- "value": null,
- "valueAsDecimal": null
}, - "buyerFee": {
- "coinPaymentsFee": null,
- "networkFee": null,
- "conversionFee": null,
- "total": null
}, - "merchantFee": {
- "coinPaymentsFee": null,
- "networkFee": null,
- "conversionFee": null,
- "total": null
}, - "gross": 0
}, - "payout": {
- "scheduledAt": "string",
- "completedAt": "string",
- "blockchainTx": "string",
- "spendRequestId": "string",
- "address": "string",
- "walletId": "string",
- "sentAt": "string",
- "expectedExecutionDate": "string",
- "receivedBlockchainTx": "string",
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "nativePayout": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "refundEmail": "string",
- "state": "string",
- "isActive": true,
- "pendingAt": "string",
- "confirmedAt": "string",
- "completedAt": "string",
- "confirmations": 0,
- "requiredConfirmations": 0
}
], - "isEmailDelivery": true,
- "emailDelivery": {
- "to": "string",
- "cc": "string",
- "bcc": "string"
}, - "notes": "string",
- "notesToRecipient": "string",
- "partialAcceptAvailable": true,
- "isLifeTimeFinished": true,
- "expires": "string"
}
]
}
]
Request to create an invoice, which is a list of goods or services with a statement of the sum due provided by the merchant, that a buyer intends to purchase
Create Invoice
Success. Invoice in all available currencies. Note, for Invoice Links flow, only "id" and "link" properties are necessary
Not Authorized
Forbidden
{- "currency": "string",
- "items": [
- {
- "customId": "string",
- "sku": "string",
- "name": "Iphone 22",
- "description": "string",
- "quantity": {
- "value": 0,
- "type": 1
}, - "originalAmount": "string",
- "amount": "string",
- "tax": "string"
}
], - "amount": {
- "breakdown": {
- "subtotal": "string",
- "shipping": "string",
- "handling": "string",
- "taxTotal": "string",
- "discount": "string"
}, - "total": "string"
}, - "isEmailDelivery": false,
- "emailDelivery": {
- "to": "string",
- "cc": "string",
- "bcc": "string"
}, - "dueDate": "2023-04-26T18:40:41.322Z",
- "invoiceDate": "2022-11-28T13:59:46+00:00",
- "draft": false,
- "clientId": "string",
- "invoiceId": false,
- "buyer": {
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}
}, - "description": "string",
- "shipping": {
- "method": "string",
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}
}, - "requireBuyerNameAndEmail": true,
- "buyerDataCollectionMessage": "string",
- "notes": "string",
- "notesToRecipient": "string",
- "termsAndConditions": "string",
- "merchantOptions": {
- "showAddress": false,
- "showPhone": false,
- "showRegistrationNumber": false,
- "showEmail": false,
- "additionalInfo": "string"
}, - "customData": { },
- "poNumber": "string",
- "webhooks": [
- {
- "notifications": [
- "invoiceCreated",
- "invoicePending",
- "invoicePaid",
- "invoiceCompleted",
- "invoiceCancelled",
- "invoiceTimedOut"
]
}
], - "payoutConfig": {
- "currencyId": "string",
- "contractAddress": "string",
- "address": "string",
- "frequency": [
- "normal",
- "asSoonAsPossible",
- "hourly",
- "nightly",
- "weekly"
]
}, - "payment": {
- "paymentCurrency": "string",
- "refundEmail": "string"
}, - "hideShoppingCart": true
}
{- "invoices": [
- {
- "id": "string",
- "link": "string",
- "checkoutLink": "string",
- "payment": {
- "paymentId": "string",
- "expires": "2023-09-02T08:06:26+00:00",
- "paymentCurrencies": [
- {
- "currency": {
- "id": "string",
- "type": [ ],
- "symbol": "string",
- "name": "string",
- "logo": "string",
- "decimalPlaces": 0,
- "rank": 0,
- "status": "string",
- "capabilities": "string",
- "urls": {
- "websites": [ ],
- "explorers": [ ]
}, - "requiredConfirmations": 0,
- "isEnabledForPayment": true
}, - "isDisabled": true,
- "amount": "string",
- "approximateNetworkAmount": "string",
- "remainingAmount": "string"
}
], - "refundEmail": "string"
}, - "hotWallet": {
- "currency": {
- "id": "1",
- "type": "crypto",
- "symbol": "BTC",
- "name": "Bitcoin",
- "logo": {
- "iamgeUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "status": "active",
- "capabilities": "string",
- "requiredConfirmations": 0,
- "isEnabledForPayment": true
}, - "amount": "string",
- "remainingAmount": { },
- "addresses": {
- "address": "string",
- "biP21": "string"
}, - "expires": "string"
}
}
]
}
Get list of merchant invoices
Success
Merchant Not Found!
[- {
- "items": [
- {
- "id": "string",
- "invoiceId": "string",
- "invoiceIdSuffix": "string",
- "created": "string",
- "invoiceDate": "string",
- "dueDate": "string",
- "confirmed": "string",
- "completed": "string",
- "cancelled": "string",
- "expires": "string",
- "currency": {
- "id": "string",
- "symbol": "string",
- "name": "string",
- "token": {
- "name": "string",
- "symbol": "string",
- "contractAddress": "string",
- "decimalPlaces": 0
}, - "logo": {
- "imageUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0
}, - "merchant": {
- "id": "string",
- "name": "string",
- "uboName": "string",
- "websiteUrl": "string",
- "country": "string",
- "logoUrl": "string",
- "email": "string",
- "address": "string",
- "phone": "string",
- "description": "string",
- "registrationNumber": "string"
}, - "merchantOptions": {
- "showAddress": true,
- "showEmail": true,
- "showPhone": true,
- "showRegistrationNumber": true,
- "additionalInfo": "string"
}, - "buyer": {
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}, - "hasData": true
}, - "description": "string",
- "items": [
- {
- "customId": "string",
- "sku": "string",
- "name": "Iphone 22",
- "description": "string",
- "quantity": {
- "value": 0,
- "type": 1
}, - "originalAmount": "string",
- "amount": "string",
- "tax": "string"
}
], - "amount": {
- "breakdown": {
- "subtotal": "string",
- "shipping": "string",
- "handling": "string",
- "taxTotal": "string",
- "discount": "string"
}, - "total": "string"
}, - "shipping": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}, - "customData": { },
- "status": "string",
- "requireBuyerNameAndEmail": true,
- "buyerDataCollectionMessage": "string",
- "notes": "string",
- "notesToRecipient": "string",
- "termsAndConditions": "string",
- "emailDelivery": {
- "to": "string",
- "cc": "string",
- "bcc": "string"
}, - "isEmailDelivery": true,
- "metadata": {
- "integration": "string",
- "hostName": "string"
}, - "poNumber": "string",
- "payoutDetails": {
- "paidTransactions": [
- {
- "hash": "string",
- "amount": {
- "displayValue": null,
- "value": null,
- "currencyId": null,
- "valueAsDecimal": null
}, - "conversionId": 0
}
], - "paidDate": "string",
- "completedTxId": "string",
- "externalAddress": "string",
- "destinationCurrencyId": "string",
- "expectedDisplayValue": "string",
- "sourceCurrencyId": "string",
- "destinationWalletId": "string",
- "isConversion": true,
- "conversionProgress": 0,
- "settlementModeErrorCode": 0,
- "destinationAmount": {
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "nativeAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "receivedBlockchainTxId": "string",
- "items": [
- {
- "currency": {
- "id": null,
- "type": [ ],
- "symbol": null,
- "name": null,
- "logo": null,
- "decimalPlaces": null,
- "rank": null,
- "status": null,
- "capabilities": null,
- "urls": { },
- "requiredConfirmations": null,
- "isEnabledForPayment": null
}, - "merchantFees": {
- "transactionFee": null,
- "networkFee": null,
- "conversionFee": null
}, - "payoutAmount": {
- "displayValue": null,
- "value": null,
- "currencyId": null,
- "valueAsDecimal": null
}, - "payoutAmountInInvoiceCurrency": {
- "displayValue": null,
- "value": null,
- "currencyId": null,
- "valueAsDecimal": null
}, - "merchantPayoutAddress": "string",
- "created": "string",
- "sent": "string",
- "expected": "string",
- "confirmed": "string",
- "state": "string"
}
], - "paging": {
- "cursor": {
- "before": "string",
- "after": "string"
}, - "limit": 0,
- "first": "string",
- "next": "string",
- "previous": "string",
- "last": "string"
}
}, - "payments": [
- {
- "paymentCurrencyId": "string",
- "paymentCurrencySymbol": "string",
- "nativeCurrencyId": "string",
- "nativeCurrencySymbol": "string",
- "expectedAmount": "string",
- "nativeExpectedAmount": "string",
- "actualAmount": "string",
- "nativeActualAmount": "string",
- "paymentAddress": "string",
- "errorCode": "string",
- "fees": {
- "paymentSubTotal": "string",
- "merchantMarkupOrDiscount": "string",
- "buyerFee": {
- "coinPaymentsFee": null,
- "networkFee": null,
- "conversionFee": null,
- "total": null
}, - "merchantFee": {
- "coinPaymentsFee": null,
- "networkFee": null,
- "conversionFee": null,
- "total": null
}, - "gross": "string"
}, - "nativeFees": {
- "paymentSubTotal": "string",
- "merchantMarkupOrDiscount": "string",
- "buyerFee": {
- "coinPaymentsFee": null,
- "networkFee": null,
- "conversionFee": null,
- "total": null
}, - "merchantFee": {
- "coinPaymentsFee": null,
- "networkFee": null,
- "conversionFee": null,
- "total": null
}, - "gross": "string"
}, - "payout": {
- "scheduledAt": "string",
- "completedAt": "string",
- "blockchainTx": "string",
- "spendRequestId": "string",
- "address": "string",
- "walletId": "string",
- "sentAt": "string",
- "expectedExecutionDate": "string",
- "receivedBlockchainTx": "string",
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "nativePayout": "string",
- "refundEmail": "string",
- "state": "string",
- "isActive": true,
- "pendingAt": "string",
- "confirmedAt": "string",
- "completedAt": "string",
- "confirmations": 0,
- "requiredConfirmations": 0
}
], - "isLifeTimeFinished": true,
- "hideShoppingCart": true
}
]
}
]
Request to create a buy-now button, which allows for quick checkout for goods or services with a statement of the sum due, that is offered by the merchant, and that a buyer intends to purchase. The request creates a button script to be inserted into the merchant's website
Create Buy-Now Button
Success.
Not Authorized
Forbidden
{- "successUrl": "string",
- "cancelUrl": "string",
- "ipnUrl": "string",
- "notifications": [ ],
- "emailNotifications": true,
- "buttonWidth": "252",
- "buttonStyle": "string",
- "invoiceId": "string",
- "type": "string",
- "items": [
- {
- "customId": "string",
- "sku": "string",
- "name": "Iphone 22",
- "description": "string",
- "quantity": {
- "value": 0,
- "type": "1"
}, - "originalAmount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "amount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "tax": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}
}
], - "amount": {
- "breakdown": {
- "subtotal": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "shipping": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "handling": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "taxTotal": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "discount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}
}, - "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "hideShoppingCart": true
}
Request to create a buy-now button, which allows for quick checkout for goods or services with a statement of the sum due, that is offered by the merchant, and that a buyer intends to purchase. The request creates a button script to be inserted into the merchant's website
Create Buy-Now Button
Success.
Not Authorized
Forbidden
{- "currency": "string",
- "items": [
- {
- "customId": "string",
- "sku": "string",
- "name": "Iphone 22",
- "description": "string",
- "quantity": {
- "value": 0,
- "type": 1
}, - "originalAmount": "string",
- "amount": "string",
- "tax": "string"
}
], - "amount": {
- "breakdown": {
- "subtotal": "string",
- "shipping": "string",
- "handling": "string",
- "taxTotal": "string",
- "discount": "string"
}, - "total": "string"
}, - "hideShoppingCart": true,
- "successUrl": "string",
- "cancelUrl": "string",
- "ipnUrl": "string",
- "notifications": [ ],
- "emailNotifications": true,
- "buttonWidth": "252",
- "buttonStyle": "string",
- "invoiceId": "string",
- "type": "string"
}
Once invoice is created and buyer selects currency for payment, by using this endpoint merchant obtains address for payment that is then displayed to buyer in the checkout window and may be used for money transfer.
Success status code (200) - Address for buyer to make payment with indication of currency, amount, and expiration timer
Unauthorized
Forbidden
{- "currency": {
- "id": "1",
- "type": "crypto",
- "symbol": "BTC",
- "name": "Bitcoin",
- "logo": {
- "iamgeUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "status": "active",
- "capabilities": "string",
- "requiredConfirmations": 0,
- "isEnabledForPayment": true
}, - "amount": {
- "rate": "string",
- "breakdown": [
- {
- "name": "string",
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
], - "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "addresses": {
- "address": "string",
- "biP21": "string"
}, - "expires": "string",
- "remainingAmount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}
}
Although it is usually sufficient to rely on webhooks for up-to-date status of your transactions, merchants are also able to verify the webhook information with this endpoint.
Success status code ( 200 ) - Status of the invoice
Unauthorized
Forbidden
{- "created": "string",
- "expires": "string",
- "status": [
- "draft",
- "scheduled",
- "unpaid",
- "pending",
- "paid",
- "completed",
- "cancelled",
- "timedOut",
- "deleted"
], - "payment": {
- "currencyId": 0,
- "confirmations": 0,
- "requiredConfirmations": 0,
- "confirmedAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "unconfirmedAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "expectedAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "partialAcceptAvailable": true
}
Get Invoice by Id
Success status code ( 200 )
Bad request example!
{- "id": "string",
- "invoiceId": "string",
- "invoiceIdSuffix": "string",
- "created": "string",
- "invoiceDate": "string",
- "dueDate": "string",
- "confirmed": "string",
- "completed": "string",
- "cancelled": "string",
- "expires": "string",
- "currency": {
- "id": "string",
- "symbol": "string",
- "name": "string",
- "token": {
- "name": "string",
- "symbol": "string",
- "contractAddress": "string",
- "decimalPlaces": 0
}, - "logo": {
- "imageUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0
}, - "merchant": {
- "id": "string",
- "name": "string",
- "uboName": "string",
- "websiteUrl": "string",
- "country": "string",
- "logoUrl": "string",
- "email": "string",
- "address": "string",
- "phone": "string",
- "description": "string",
- "registrationNumber": "string"
}, - "merchantOptions": {
- "showAddress": true,
- "showEmail": true,
- "showPhone": true,
- "showRegistrationNumber": true,
- "additionalInfo": "string"
}, - "buyer": {
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}, - "hasData": true
}, - "description": "string",
- "items": [
- {
- "customId": "string",
- "sku": "string",
- "name": "Iphone 22",
- "description": "string",
- "quantity": {
- "value": 0,
- "type": "1"
}, - "originalAmount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "amount": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}, - "tax": {
- "currencyId": "string",
- "displayValue": "string",
- "value": "20000",
- "valueAsDecimal": 20000
}
}
], - "amount": {
- "breakdown": {
- "subtotal": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "shipping": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "handling": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "taxTotal": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "discount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": "string"
}, - "shipping": {
- "method": "string",
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}, - "hasData": true
}, - "customData": "string",
- "status": "string",
- "requireBuyerNameAndEmail": true,
- "buyerDataCollectionMessage": "string",
- "notes": "string",
- "notesToRecipient": "string",
- "termsAndConditions": "string",
- "emailDelivery": {
- "to": "string",
- "cc": "string",
- "bcc": "string"
}, - "isEmailDelivery": false,
- "metadata": {
- "integration": "string",
- "hostname": "string"
}, - "poNumber": "string",
- "payoutDetails": {
- "paidTransactions": [
- {
- "hash": "string",
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "conversionId": 0
}
], - "paidDate": "string",
- "completedTxId": "string",
- "externalAddress": "string",
- "destinationCurrencyId": "string",
- "expectedDisplayValue": "string",
- "sourceCurrencyId": "string",
- "destinationWalletId": "string",
- "isConversion": true,
- "conversionProgress": 0,
- "settlementModeErrorCode": 0,
- "destinationAmount": {
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "nativeAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "receivedBlockchainTxId": "string",
- "items": [
- {
- "currency": {
- "id": "string",
- "type": [ ],
- "symbol": "string",
- "name": "string",
- "logo": "string",
- "decimalPlaces": 0,
- "rank": 0,
- "status": "string",
- "capabilities": "string",
- "urls": {
- "websites": [ ],
- "explorers": [ ]
}, - "requiredConfirmations": 0,
- "isEnabledForPayment": true
}, - "merchantFees": {
- "transactionFee": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "networkFee": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "conversionFee": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "payoutAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "payoutAmountInInvoiceCurrency": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "merchantPayoutAddress": "string",
- "created": "string",
- "sent": "string",
- "expected": "string",
- "confirmed": "string",
- "state": "string"
}
], - "paging": {
- "cursor": {
- "before": "string",
- "after": "string"
}, - "limit": 0,
- "first": "string",
- "next": "string",
- "previous": "string",
- "last": "string"
}
}, - "payments": [
- {
- "expectedAmount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "nativeExpectedAmount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "actualAmount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "nativeActualAmount": null,
- "paymentAddress": "string",
- "errorCode": "string",
- "fees": {
- "paymentSubTotal": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "merchantMarkupOrDiscount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "buyerFee": {
- "coinPaymentsFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "networkFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "conversionFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "total": 0
}, - "merchantFee": {
- "coinPaymentsFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "networkFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "conversionFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "total": 0
}, - "gross": 0
}, - "nativeFees": {
- "paymentSubTotal": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "merchantMarkupOrDiscount": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "buyerFee": {
- "coinPaymentsFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "networkFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "conversionFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "total": 0
}, - "merchantFee": {
- "coinPaymentsFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "networkFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "conversionFee": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "total": 0
}, - "gross": 0
}, - "payout": {
- "scheduledAt": "string",
- "completedAt": "string",
- "blockchainTx": "string",
- "spendRequestId": "string",
- "address": "string",
- "walletId": "string",
- "sentAt": "string",
- "expectedExecutionDate": "string",
- "receivedBlockchainTx": "string",
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "nativePayout": {
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "refundEmail": "string",
- "state": "string",
- "isActive": true,
- "pendingAt": "string",
- "confirmedAt": "string",
- "completedAt": "string",
- "confirmations": 0,
- "requiredConfirmations": 0
}
], - "isLifeTimeFinished": true,
- "hideShoppingCart": true
}
Get Invoice by Id
Success status code ( 200 )
Bad request example!
{- "id": "string",
- "invoiceId": "string",
- "invoiceIdSuffix": "string",
- "created": "string",
- "invoiceDate": "string",
- "dueDate": "string",
- "confirmed": "string",
- "completed": "string",
- "cancelled": "string",
- "expires": "string",
- "currency": {
- "id": "string",
- "symbol": "string",
- "name": "string",
- "token": {
- "name": "string",
- "symbol": "string",
- "contractAddress": "string",
- "decimalPlaces": 0
}, - "logo": {
- "imageUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0
}, - "merchant": {
- "id": "string",
- "name": "string",
- "uboName": "string",
- "websiteUrl": "string",
- "country": "string",
- "logoUrl": "string",
- "email": "string",
- "address": "string",
- "phone": "string",
- "description": "string",
- "registrationNumber": "string"
}, - "merchantOptions": {
- "showAddress": true,
- "showEmail": true,
- "showPhone": true,
- "showRegistrationNumber": true,
- "additionalInfo": "string"
}, - "buyer": {
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}, - "hasData": true
}, - "description": "string",
- "items": [
- {
- "customId": "string",
- "sku": "string",
- "name": "Iphone 22",
- "description": "string",
- "quantity": {
- "value": 0,
- "type": 1
}, - "originalAmount": "string",
- "amount": "string",
- "tax": "string"
}
], - "amount": {
- "breakdown": {
- "subtotal": "string",
- "shipping": "string",
- "handling": "string",
- "taxTotal": "string",
- "discount": "string"
}, - "total": "string"
}, - "shipping": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}, - "customData": { },
- "status": "string",
- "requireBuyerNameAndEmail": true,
- "buyerDataCollectionMessage": "string",
- "notes": "string",
- "notesToRecipient": "string",
- "termsAndConditions": "string",
- "emailDelivery": {
- "to": "string",
- "cc": "string",
- "bcc": "string"
}, - "isEmailDelivery": true,
- "metadata": {
- "integration": "string",
- "hostName": "string"
}, - "poNumber": "string",
- "payoutDetails": {
- "paidTransactions": [
- {
- "hash": "string",
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "conversionId": 0
}
], - "paidDate": "string",
- "completedTxId": "string",
- "externalAddress": "string",
- "destinationCurrencyId": "string",
- "expectedDisplayValue": "string",
- "sourceCurrencyId": "string",
- "destinationWalletId": "string",
- "isConversion": true,
- "conversionProgress": 0,
- "settlementModeErrorCode": 0,
- "destinationAmount": {
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "nativeAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "receivedBlockchainTxId": "string",
- "items": [
- {
- "currency": {
- "id": "string",
- "type": [ ],
- "symbol": "string",
- "name": "string",
- "logo": "string",
- "decimalPlaces": 0,
- "rank": 0,
- "status": "string",
- "capabilities": "string",
- "urls": {
- "websites": [ ],
- "explorers": [ ]
}, - "requiredConfirmations": 0,
- "isEnabledForPayment": true
}, - "merchantFees": {
- "transactionFee": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "networkFee": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "conversionFee": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "payoutAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "payoutAmountInInvoiceCurrency": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "merchantPayoutAddress": "string",
- "created": "string",
- "sent": "string",
- "expected": "string",
- "confirmed": "string",
- "state": "string"
}
], - "paging": {
- "cursor": {
- "before": "string",
- "after": "string"
}, - "limit": 0,
- "first": "string",
- "next": "string",
- "previous": "string",
- "last": "string"
}
}, - "payments": [
- {
- "paymentCurrencyId": "string",
- "paymentCurrencySymbol": "string",
- "nativeCurrencyId": "string",
- "nativeCurrencySymbol": "string",
- "expectedAmount": "string",
- "nativeExpectedAmount": "string",
- "actualAmount": "string",
- "nativeActualAmount": "string",
- "paymentAddress": "string",
- "errorCode": "string",
- "fees": {
- "paymentSubTotal": "string",
- "merchantMarkupOrDiscount": "string",
- "buyerFee": {
- "coinPaymentsFee": "string",
- "networkFee": "string",
- "conversionFee": "string",
- "total": 0
}, - "merchantFee": {
- "coinPaymentsFee": "string",
- "networkFee": "string",
- "conversionFee": "string",
- "total": 0
}, - "gross": "string"
}, - "nativeFees": {
- "paymentSubTotal": "string",
- "merchantMarkupOrDiscount": "string",
- "buyerFee": {
- "coinPaymentsFee": "string",
- "networkFee": "string",
- "conversionFee": "string",
- "total": 0
}, - "merchantFee": {
- "coinPaymentsFee": "string",
- "networkFee": "string",
- "conversionFee": "string",
- "total": 0
}, - "gross": "string"
}, - "payout": {
- "scheduledAt": "string",
- "completedAt": "string",
- "blockchainTx": "string",
- "spendRequestId": "string",
- "address": "string",
- "walletId": "string",
- "sentAt": "string",
- "expectedExecutionDate": "string",
- "receivedBlockchainTx": "string",
- "currencySymbol": "string",
- "currencyId": "string",
- "displayValue": "string",
- "value": "string",
- "valueAsDecimal": 0
}, - "nativePayout": "string",
- "refundEmail": "string",
- "state": "string",
- "isActive": true,
- "pendingAt": "string",
- "confirmedAt": "string",
- "completedAt": "string",
- "confirmations": 0,
- "requiredConfirmations": 0
}
], - "isLifeTimeFinished": true,
- "hideShoppingCart": true
}
Get payout details for an invoice, including if invoice has been fully paid out, the exact amount the merchant will receive and in what currency, which address payout will be deposited to, and who (Buyer) performed the payment.
Success
Merchant Not Found!
{- "paidTransactions": [
- {
- "hash": "string",
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "1"
}, - "conversionId": 0
}
], - "paidDate": "string",
- "completedTxId": "string",
- "externalAddress": "string",
- "destinationCurrencyId": "string",
- "expectedDisplayValue": "string",
- "sourceCurrencyId": "string",
- "destinationAccountId": "string",
- "isConversion": false,
- "conversionProgress": 0,
- "settlementModeErrorCode": 0,
- "destinationAmount": {
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "nativeAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "items": [
- {
- "currency": {
- "id": "nKCMuD6h3Vsgs4mGDqGeV",
- "type": "string",
- "symbol": "BTC",
- "name": "string",
- "logo": {
- "imageUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "capabilities": [
- "multiSigAccounts"
], - "urls": {
- "websites": [
- "string"
], - "explorers": [
- "string"
]
}
}, - "merchantFees": {
- "transactionFees": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "networkFee": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "conversionFee": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}
}, - "payoutAmount": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "payoutAmountInInvoiceCurrency": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "merchantFeesInInvoiceCurrency": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "merchantPayoutAddress": "string",
- "sent": "2022-11-29T19:10:04.228Z",
- "created": "2022-11-29T19:10:04.228Z",
- "expected": "2022-11-29T19:10:04.228Z",
- "confirmed": "2022-11-29T19:10:04.228Z",
- "state": "string"
}
]
}
Get payout details for an invoice, including if invoice has been fully paid out, the exact amount the merchant will receive and in what currency, which address payout will be deposited to, and who (Buyer) performed the payment.
Success
Merchant Not Found!
{- "paidTransactions": [
- {
- "hash": "string",
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "1"
}, - "conversionId": 0
}
], - "paidDate": "string",
- "completedTxId": "string",
- "externalAddress": "string",
- "destinationCurrencyId": "string",
- "expectedDisplayValue": "string",
- "sourceCurrencyId": "string",
- "destinationAccountId": "string",
- "isConversion": false,
- "conversionProgress": 0,
- "settlementModeErrorCode": 0,
- "destinationAmount": {
- "amount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}, - "nativeAmount": {
- "displayValue": "string",
- "value": "string",
- "currencyId": "string",
- "valueAsDecimal": "string"
}
}, - "items": [
- {
- "currency": {
- "id": "nKCMuD6h3Vsgs4mGDqGeV",
- "type": "string",
- "symbol": "BTC",
- "name": "string",
- "logo": {
- "imageUrl": "string",
- "vectorUrl": "string"
}, - "decimalPlaces": 0,
- "rank": 0,
- "capabilities": [
- "multiSigAccounts"
], - "urls": {
- "websites": [
- "string"
], - "explorers": [
- "string"
]
}
}, - "merchantFees": {
- "transactionFees": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "networkFee": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "conversionFee": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}
}, - "payoutAmount": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "payoutAmountInInvoiceCurrency": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "merchantFeesInInvoiceCurrency": {
- "displayValue": "string",
- "contractAddress": "mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9",
- "value": "string",
- "currencyId": "1"
}, - "merchantPayoutAddress": "string",
- "sent": "2022-11-29T19:10:04.228Z",
- "created": "2022-11-29T19:10:04.228Z",
- "expected": "2022-11-29T19:10:04.228Z",
- "confirmed": "2022-11-29T19:10:04.228Z",
- "state": "string"
}
]
}
List history events of an invoice by the invoice Id
Success
Merchant Not Found!
{- "items": [
- {
- "timestamp": "2023-05-29T19:58:50.043Z",
- "eventType": "string"
}
], - "paging": {
- "cursor": {
- "before": "string",
- "after": "string"
}, - "limit": 0,
- "first": "string",
- "next": "string",
- "previous": "string",
- "last": "string"
}
}
List history events of an invoice by the invoice Id
Success
Merchant Not Found!
{- "items": [
- {
- "timestamp": "2023-05-29T19:58:50.043Z",
- "eventType": "string"
}
], - "paging": {
- "cursor": {
- "before": "string",
- "after": "string"
}, - "limit": 0,
- "first": "string",
- "next": "string",
- "previous": "string",
- "last": "string"
}
}
CoinPayments API offers webhook notifications, a powerful feature that allows merchants to seamlessly enable and manage notifications sent from CoinPayments API to their own merchant API when specific events occur. This provides merchants with real-time updates on important activities within their CoinPayments account.
To set up webhook notifications, merchants can easily define a public endpoint URL on their server API and specify the events for which they want to receive notifications.
CoinPayments will send webhooks from one of these IPs:
hook1.coinpayments.com
- 23.183.244.249
hook2.coinpayments.com
- 23.183.244.250
Currently, CoinPayments supports webhook notifications for the following transaction types:
This section provides information focused on the invoices webhooks. Webhooks for withdrawals and deposits are set up within Create-wallet and Create-address-for-an-existing-wallet requests. You can find more information about this in Wallets API.
Here is a list of invoice events for which merchants can choose to receive notifications:
To see the webhook payload definition, see Webhook Payload.
Merchants have the flexibility to set up webhooks either through the user-friendly UI or via API calls. To set up webhook notifications, first, create an API integration via CoinPayments UI. Then follow these steps:
To create a webhook through the UI, continue in the popup screen with the following steps:
To set up webhook notifications through the API calls, follow these steps:
Create a webhook using 'createWebhook' endpoint indicating merchant's 'clientId' of the API integration.
In the request body provide a list of notification types you want to receive in the 'notifications' parameter. Possible values are: 'invoiceCreated', 'invoicePending', 'invoicePaid', 'invoiceCompleted', 'invoiceCancelled', 'invoiceTimedOut'.
Note: If the list of notifications that merchant wants to receive is not provided, the merchant will receive a "bad request" error in the response
In the request body provide your server URL where the notifications will be sent in the 'notificationsUrl' parameter.
Once completed, your webhook notifications are all set, and your API will receive notifications based on the events you have chosen. This allows you to stay updated in real-time on the activities that matter most to your business.
Note: Webhooks are tied to integration clients, and merchants can create multiple clients under their main account on the CoinPayments website, providing flexibility and customization options.
Notification Payload will include the event type, timestamp of the invoice status update, and the actual invoice object.
Below is a descriptive flowchart illustrating the process of webhook notifications. This example specifically focuses on the scenario where the merchant intends for their server API to receive notifications upon invoice completion.
All webhook messages from CoinPayments contain the same headers as used by merchants to sign requests to CoinPayments API:
const headers = {
'X-CoinPayments-Client': clientId,
'X-CoinPayments-Timestamp': date,
'X-CoinPayments-Signature': signature,
};
By verifying the signature with the help of the private key, merchant can make sure that the received webhook is produced by CoinPayments server.
Here is an example of the received notification with headers included:
POST
to webhook URL: http://localhost:9004/api/invoices/callbacks
Headers:
X-CoinPayments-Signature = 60NsOvvOwtWxtNBpkrY615Y3iPNGDAWReegr2LUwIpY=
X-CoinPayments-Client = dc6a16e545c34187ba21a9edbbe484a5
X-CoinPayments-Timestamp = 2024-07-01T11:04:10
Body (JSON):
{
"id": "8a49a588266246a2ab5f43217ca993bd",
"type": "InvoiceCreated",
"timestamp": "2024-07-01T11:04:06.8033575+00:00",
"invoice": {
"invoiceId": "0067",
"id": "2008d68d-0f66-44ec-8500-68d054b882b9",
"userId": "fd2d3885-b90b-4c8a-bf6d-bd94970781db",
"userEmail": "mykola.lutsenko+t21@hypedriven.com",
"merchantId": "91695d60-c082-406d-a2ed-5be6fbae58a4",
"merchantClientId": "dc6a16e5-45c3-4187-ba21-a9edbbe484a5",
"invoiceNumber": "0067",
"invoiceNumberSuffix": null,
"createdAt": 1719831846,
"invoiceDate": null,
"dueDate": null,
"description": null,
"expiresDate": 1751367846,
"customData": null,
"notes": null,
"notesToRecipient": null,
"buyerDataCollectionMessage": null,
"termsAndConditions": null,
"metadata": null,
"poNumber": null,
"buyer": null,
"shipping": null,
"lineItems": [
{
"amount": 10000,
"customId": null,
"description": null,
"name": "test item",
"originalAmount": 10000,
"quantity": 1,
"sku": null,
"tax": null,
"type": "Quantity"
}
],
"merchantOptions": {
"additionalInfo": null,
"showAddress": false,
"showEmail": true,
"showPhone": false,
"showRegistrationNumber": false
},
"emailDeliveryOptions": null,
"amount": {
"currency": {
"id": 5057,
"smartContract": null
},
"subtotal": 10000,
"shippingTotal": 0,
"handlingTotal": 0,
"discountTotal": 0,
"taxTotal": 0,
"total": 10000
},
"state": "Unpaid",
"flags": {
"requireBuyerNameAndEmail": false,
"sendPaymentCompleteEmailNotification": false,
"isPos": false
},
"canceledAt": null,
"completedAt": null,
"confirmedAt": null,
"payments": [],
"payoutConfig": null,
"partialAcceptAvailable": false
}
}
By using the following secret:
ClientSecret
- 9ZFHcnGMxawADeXRfDtNkQDCjFUK5998oOMhl51QvzM=
merchant can verify the signature within the header:
X-CoinPayments-Signature = 60NsOvvOwtWxtNBpkrY615Y3iPNGDAWReegr2LUwIpY=
thus, making sure the webhook notification is authentic.
All webhooks sent by CPS API contain information on the event they signalize about and information on the invoice and payment to which the event refers. Below is the payload of the webhooks sent from CPs API to your server API.
Success status code ( 200 )
CoinPayments API could not reach your server
{- "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "type": "invoiceCreated",
- "timestamp": "2023-04-07T06:58:19.9798764+00:0",
- "invoice": {
- "invoiceId": "string",
- "id": "string",
- "userId": "string",
- "merchantId": "string",
- "merchantClientId": "string",
- "invoiceNumber": "string",
- "invoiceNumberSuffix": "string",
- "createdAt": "string",
- "invoiceDate": "string",
- "dueDate": "string",
- "description": "string",
- "expiresDate": "string",
- "customData": {
- "additionalProp1": "string",
- "additionalProp2": "string",
- "additionalProp3": "string"
}, - "notes": "string",
- "notesToRecipient": "string",
- "buyerDataCollectionMessage": "string",
- "termsAndConditions": "string",
- "metadata": {
- "integration": "string",
- "hostname": "string"
}, - "poNumber": "string",
- "buyer": {
- "companyName": "string",
- "email": "string",
- "firstName": "string",
- "lastName": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}
}, - "shipping": {
- "method": "string",
- "companyName": "string",
- "name": {
- "firstName": "string",
- "lastName": "string"
}, - "emailAddress": "string",
- "phoneNumber": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "provinceOrState": "string",
- "city": "string",
- "suburbOrDistrict": "string",
- "countryCode": "string",
- "postalCode": "string"
}
}, - "lineItems": {
- "amount": "string",
- "customId": "string",
- "description": "string",
- "name": "string",
- "originalAmount": "string",
- "quantity": 0,
- "sku": "string",
- "tax": "string",
- "type": "string"
}, - "merchantOptions": {
- "showAddress": false,
- "showPhone": false,
- "showRegistrationNumber": false,
- "showEmail": false,
- "additionalInfo": "string"
}, - "emailDeliveryOptions": {
- "to": "string",
- "cc": "string",
- "bcc": "string"
}, - "amount": {
- "currencyId": 0,
- "subtotal": "string",
- "shippingTotal": "string",
- "handlingTotal": "string",
- "discountTotal": "string",
- "taxTotal": "string",
- "total": "string"
}, - "state": "string",
- "flags": {
- "requireBuyerNameAndEmail": true,
- "sendPaymentCompleteEmailNotification": true,
- "isPos": true
}, - "canceledAt": 0,
- "completedAt": 0,
- "confirmedAt": 0,
- "payments": [
- {
- "id": "string",
- "invoiceId": "string",
- "createdAt": 0,
- "expiresAt": 0,
- "cancelledAt": 0,
- "detectedAt": 0,
- "pendingAt": 0,
- "confirmedAt": 0,
- "completedAt": 0,
- "scheduledAt": 0,
- "state": "string",
- "refundedAt": 0,
- "refundEmail": "string",
- "isGuest": true,
- "hotWallet": {
- "nativeCurrency": {
- "id": 0,
- "smartContract": "string"
}, - "paymentSubTotalInNativeCurrency": 0,
- "merchantMarkupOrDiscountInNativeCurrency": 0,
- "buyerFeeInNativeCurrency": {
- "coinPaymentsFee": 0,
- "networkFee": 0,
- "conversionFee": 0
}, - "merchantFeeInNativeCurrency": {
- "coinPaymentsFee": 0,
- "networkFee": 0,
- "conversionFee": 0
}, - "confirmedAmountInNativeCurrency": 0,
- "unconfirmedAmountInNativeCurrency": 0,
- "id": "string",
- "paymentId": "string",
- "currency": {
- "id": 0,
- "smartContract": { }
}, - "merchantPayoutCurrency": {
- "id": 0,
- "smartContract": { }
}, - "currencyRateFromInvoiceCurrency": 0,
- "paymentReceiveAddress": "string",
- "merchantPayoutAddress": "string",
- "merchantPayoutWalletId": "string",
- "paymentSubTotal": "string",
- "merchantMarkupOrDiscount": 0,
- "isConversion": true,
- "buyerFee": {
- "coin_payments_fee": 0,
- "network_fee": 0,
- "conversion_fee": 0
}, - "merchantFee": {
- "coin_payments_fee": 0,
- "network_fee": 0,
- "conversion_fee": 0
}, - "payoutFrequency": "string",
- "createdAt": 0,
- "error": {
- "code": "string",
- "message": [
- "Unknown = 0",
- "NegativeRate = 1",
- "PayoutAddressIsNull = 2",
- "PaymentSubTotalIsLessThanMerchantTotalFee = 4",
- "TotalBuyerWillPayIsNegativeOrZero = 8",
- "TotalBuyerWillPayIsLessThanBuyerNetworkFee = 16",
- "TotalMerchantFeeRatioIsMoreThanMaximumRatioSetting = 32",
- "PayoutAmountIsLessThanDust = 64",
- "CurrencyIsNotActive = 128",
- "AmountIsBelowOfConversionLimit = 256",
- "AmountIsAboveOfConversionLimit = 512",
- "UserLimitIsReached = 1024",
- "NotEnoughToActivateRippleAddress = 2048",
- "ConversionPairDoesNotExist = 4096",
- "AddressIsNotValid = 8_192",
- "DoesNotHaveCompletedKyc = 16_384",
- "UnstoppableDomainNotFound = 32_768",
- "UnstoppableDomainNotFoundForCurrency = 65_536",
- "UserWalletIsLocked = 131_072"
]
}, - "confirmations": 0,
- "confirmedAmount": 0,
- "requiredConfirmations": 0,
- "unconfirmedAmount": 0,
- "assignment": {
- "assignedFrom": "string",
- "assignedUntil": "string",
- "completedDate": "string"
}, - "pooledWalletId": "string",
- "expiresAt": 0
}, - "payout": {
- "destinationAmountInNativeCurrency": 0,
- "payoutAmountToMerchantInNativeCurrency": 0,
- "buyerBlockchainFeeAfterGroupingInNativeCurrency": 0,
- "merchantBlockchainFeeAfterGroupingInNativeCurrency": 0,
- "id": "string",
- "invoicePaymentId": "string",
- "invoicePaymentHotWalletId": "string",
- "created": "string",
- "sent": "string",
- "confirmed": "string",
- "failed": "string",
- "merchantPayoutWalletId": "string",
- "merchantPayoutWalletCurrencyId": 0,
- "merchantPayoutWalletSmartContract": { },
- "merchantPayoutAddress": "string",
- "payoutAmountToMerchant": 0,
- "blockchainTransactionId": "string",
- "state": "string",
- "batchId": "string",
- "destinationAmount": 0,
- "transactionId": 0,
- "buyerBlockchainFeeAfterGrouping": 0,
- "merchantBlockchainFeeAfterGrouping": 0
}, - "refund": {
- "payoutAmountInNativeCurrency": 0,
- "payoutNetworkFeesInNativeCurrency": 0,
- "estimatedNetworkFeesInNativeCurrency": 0
}, - "isActive": true
}
], - "payoutConfig": {
- "currencyId": {
- "id": 0,
- "smart_contract": "string"
}, - "address": "string",
- "wallet_id": "string",
- "frequency": [
- "normal",
- "asSoonAsPossible",
- "hourly",
- "nightly",
- "weekly"
]
}, - "partialAcceptAvailable": true
}
}
Creates new client webhook
Success
Merchant Not Found!
{- "notifications": [
- "invoiceCreated",
- "invoicePending",
- "invoicePaid",
- "invoiceCompleted",
- "invoiceCancelled",
- "invoiceTimedOut"
]
}
{- "id": "0a54b29f-51cb-44a8-9bed-111c5cb1b335"
}
Get list of merchant webhook notifications
Success - List of merchant webhook notifications
Merchant Not Found!
{- "items": {
- "id": "wLKBuD6h3Vama4mGDqHeF",
- "notifications": [
- "invoiceCreated",
- "invoicePending",
- "invoicePaid",
- "invoiceCompleted",
- "invoiceCancelled",
- "invoiceTimedOut"
], - "paging": {
- "cursor": {
- "before": "string",
- "after": "string"
}, - "limit": 0,
- "first": "string",
- "next": "string",
- "previous": "string",
- "last": "string"
}
}
}
Update list of webhook notifications and/or webhook integration Url
Success
Webhook not found
{- "notifications": [
- "invoiceCreated",
- "invoicePending",
- "invoicePaid",
- "invoiceCompleted",
- "invoiceCancelled",
- "invoiceTimedOut"
]
}