diff --git a/.gitignore b/.gitignore index 67cb5ca..44ec8ec 100755 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ _site/ _pdf .DS_Store .idea +node_modules +.env diff --git a/.redocly.yaml b/.redocly.yaml new file mode 100644 index 0000000..f9fcbc0 --- /dev/null +++ b/.redocly.yaml @@ -0,0 +1,28 @@ +# See https://redocly.com/docs/cli/configuration/ for more information. +apis: + sample@v1: + root: ./openapi/openapi.yaml + sample@v2: + root: ./openapi/openapi-2.yaml +versionPicker: + showForUnversioned: true +lint: + extends: + - recommended + rules: + no-unused-components: error +pagination: none +features.openapi: + showConsole: true + htmlTemplate: ./docs/index.html + theme: + colors: + primary: + main: "#32329f" + generateCodeSamples: + languages: # Array of language config objects; indicates in which languages to generate code samples. + - lang: curl + - lang: Node.js + - lang: JavaScript + - lang: PHP + - lang: Python diff --git a/CoinIntegration/index.html b/CoinIntegration/index.html deleted file mode 100644 index 40b6949..0000000 --- a/CoinIntegration/index.html +++ /dev/null @@ -1,132 +0,0 @@ - -Coin Integration Instructions

Introduction

This document describes general guidelines for adding a specific coin support to the CoinPayments platform. It explains which features should be implemented in order to integrate with the existing wallet functionality. It provides an overview of already implemented coins together with samples and suggestions for adding new ones.

High level cryptocurrencies overview

All of the coins belong to one of the 2 groups based on their implementation details:

  1. UTXO (Unspent transaction output) scheme is used in Bitcoin and other similar coins. The idea being is that a transaction is a redistribution of existing outputs to new addresses allowing to have multiple addresses as sources and destinations within a single transaction. The UTXO can only be spent or unspent usually meaning the one of the outputs of the transactions goes back to the
  2. Account-based scheme is used in Ethereum and other similar coins. The idea being is that an account behaves like a traditional bank account where you have some funds and can spend any part of it. Account-based coins only allow a single sender and a single receiver
  3. Sometimes a currency can be some combination of both previous types e.g. OmniLayer is built on top of the Bitcoin network where accounts hold token balances but also BTC is needed to fund transactions.

CoinPayments supports these types of coins having implementations which vary depending on a specific coin type

System implementation overview

The system is built using the C# programming language and .NET 5 running on Linux VMs so the code must be running correctly in this environment (older .NET 4.x framework is not allowed),

General coin implementation requirements and guidelines

  1. Coin API being used must be supported by a publicly available coin node which will be hosted in the CoinPayments network, some coins have more advanced APIs only available via their sites, this is not allowed for usage
  2. Transaction building and signing must be done offline meaning the private key should never leave the boundaries of the process it is being used in. This means the wallet or similar API of the coin node is not allowed for usage.
  3. All operations should be done in coin’s minimum atomic units e.g. Satoshis for Bitcoin or Weis for Ethereum, same applies to tokens (smart contracts) or similar entities
  4. Minimum set of operations to be implemented for the coin:
  1. Generate an address. Prefer using bip44 extended key format if possible, otherwise use other types of seeds or private keys directly to get the address from. This address should be a valid blockchain address eligible for receiving coins
  2. Get the balance of the address. Should return amount of coins available to be spent from the address
  3. Validate transfer. Should check if the receiving address is a valid address for the coin and if the payment amount is valid (e.g. some coins require an “activating” deposit or the amount can be below dust threshold for UTXO coins or anything else coin specific)
  4. Build and sign the transaction. Should build a valid string or byte array for the transaction ready to be broadcast to the network. This should be done offline without the private key being sent out of the system.
  5. Estimate blockchain transfer fee. Should estimate a blockchain fee for the transaction to be sent to the network. Should have a comment describing the expected confirmation time and explaining how to adjust it if needed. Can be a static value. Can depend on other values (e.g. network load or transaction size), those should be specified and explained.
  6. Broadcast a signed transaction. Should broadcast the signed transaction to the network. Should return a transaction hash or similar allowing to look the transaction up in the coin explorer. Should handle rebroadcasts (same transaction being sent for the second time) and any other possible issues. Should indicate if the transfer was successful or not (accepted or rejected by the network)
  7. Read a transaction from blockchain. Should inspect a raw transaction from the coin node and detect if any of the transaction senders or receivers belong to a provided list of existing addresses known to the system in order to process deposits or to confirm transfers from those.
  8. Changes for Testnet (optional). Describe possible changes needed to be made in order to use the testnet instead of the main chain (if available)

  1. Implementation requirements and guidelines for C# developers:
  1. Always keep performance in mind. Prefer fast APIs for working with memory (Span and similar), avoid unnecessary allocation and copying.
  2. Do not use unsafe code
  3. Do not use 3rd party packages with closed source code, do not use commercial solutions
  4. Use Nullable reference types
  5. Use async API, do not do blocking calls
  6. Write tests demonstrating the usage of implemented operations

Acceptance criteria and demo

After all the operations are implemented following the provided requirements they should all be combined in a demo showing the following user story:

  1. Addresses A and B are generated
  2. Address A receives an external deposit from a 3rd party wallet (transaction is parsed and A is detected as a receiver)
  3. Using the private key for A the transaction is built sending the received coins to the address B.
  4. The built transaction is sent to the network
  5. Address B receives an external deposit from address A (transaction is parsed and A is detected as a sender while B is detected as a receiver)

Transfer from Account-Based coins

This section describes operations with account-based coins including the specific parameters with their types and includes samples of usage for already implemented coins in the CoinPayments system.


Inputs

Parameter

Description

Data type

senderPrivateKey(or keySeed)

PrivateKey(or Seed) user who wants to send coins

string

fromAddress

The address from which the coins are sent

string

toAddress

The address to which the coins are sent

string

amount

Amount without fees

decimal

blockchainFee

Blockchain Fee

decimal

idempotenceData

A certain transaction parameter that avoids duplicates(for example sequence number in Ripple and Stellar)

string?


Outputs

Parameter

Description

Data type

TxAmount

Transaction amount

decimal

TxHash

Transaction Hash

string

IsSuccesful

indicates whether the transaction was successful or not

bool

Note: PrivateKey(or Seed) should not be sent to the node, the creation and signing of the transaction must be offline

For example: Ethereum transfer

private async Task<AccountBasedBlockchainSpendResult> TransferEth(

string senderPrivateKey,

string fromAddress,

string toAddress,

decimal amountWithoutFees,

decimal blockchainFee,

string? idempotenceData)

{

var amountInEther = Web3.Convert.FromWei(new BigInteger(amountWithoutFees));

var gasLimit = await EstimateEthTransferGas(toAddress, amountWithoutFees);

var gasPriceWei = blockchainFee / gasLimit;

var txHash = await _ethereumClient.TransferEtherAsync(senderPrivateKey, toAddress, amountInEther, gasPriceWei, gasLimit, idempotenceData!);

var txAmount = amountWithoutFees + blockchainFee;

return new AccountBasedBlockchainSpendResult

{

TxAmount = txAmount,

IsSuccessful = true,

TxHash = txHash

};

}

Note: if idempotenceData in this transaction will be the same as in the last transaction then we will not be able to successfully broadcast this transaction

We calculate gasLimit and gasPriceWei and pass it to the following method


public async Task<string> TransferEtherAsync(

string privateKey,

string toAddress,

decimal amountInEther,

decimal gasPriceWei,

decimal gasLimit,

string nonce)

{

var web3 = new Web3(new Nethereum.Web3.Accounts.Account

(privateKey), CurrentEnvironment.EtcNodeUrl);

var txCount = new HexBigInteger(new BigInteger(decimal.Parse(nonce)));

var gasPrice = new BigInteger(gasPriceWei);

var amount = Nethereum.Util.UnitConversion.Convert.ToWei(amountInEther);

var limit = new BigInteger(gasLimit);

var signedTx = Web3.OfflineTransactionSigner.SignTransaction(privateKey, toAddress, amount, txCount.Value, gasPrice, limit);

try

{

var txId = await web3.Eth.Transactions.SendRawTransaction.SendRequestAsync("0x" + signedTx);

return txId;

}

catch (Nethereum.JsonRpc.Client.RpcResponseException rpcException) when (rpcException.Message == "nonce too low")

{

var txHash = "0x" + new ABIEncode().GetSha3ABIEncodedPacked(("0x" + signedTx).HexToByteArray()).ToHex();

return txHash;

}

}

We use the Web3 library for offline transaction signing and broadcast it to the node using the post method which takes a parameter signed Tx

private async Task<string> BroadcastSignedTxAsync(

string signedTx)

{

object[] _params = new object[1]

{

$"0x{signedTx}"

};

var response = await PostAsJsonAsync(_baseUrl, new EthereumJsonRpcRequest()

{

id = 1,

jsonrpc = "2.0",

method = "eth_sendRawTransaction",

_params = _params

});

var callResponse = JsonSerializer.Deserialize<EthereumCallResponse>(response);

return callResponse.result;

}

And deserialize the response of the node to our request in the format which we need


Transfer from UTXOs

This section describes how the transfer from UTXO coins is implemented and shows and examples of code being used


Inputs

Parameter

Data type

utxos

List<Utxo>

privateKeys

string[]

destinations

List<(string DestinationAddress, decimal Amount)>

changeAddress

string

blockchainFee

decimal

Utxos:

Parameter

Data type

Amount

ulong

Address

string

TxHash

string

TxOutputIndex

int

Output: string TxHash

For example: Bitcoin transfer

public async Task<string> TransferFromBtc(

List<Utxo> utxos,

string[] privateKeys,

List<(string DestinationAddress, decimal Amount)> destinations,

string changeAddress,

decimal blockchainFee)

{

var currencyNetwork = Network.Main;

var amountWithoutFees = destinations.Sum(p => p.Amount);

var txHash = await BuildTransactionAndBroadcastAsync();

return txHash;

Coin ToCoin(Utxo utxo)

{

var hash = uint256.Parse(utxo.TxHash);

var outPoint = new OutPoint(hash, utxo.TxOutputIndex);

var money = Money.Satoshis(utxo.Amount);

var utxoAddress = utxo.Address;

var fromTxOut = new TxOut(money, BitcoinAddress.Create(utxoAddress, currencyNetwork));

return new Coin(outPoint, fromTxOut);

}

async Task<string> BuildTransactionAndBroadcastAsync()

{

var signedTx = currencyNetwork.CreateTransactionBuilder()

.AddCoins(utxos.Select(ToCoin))

.AddKeys(privateKeys.Select(key => Key.Parse(key, currencyNetwork)).ToArray())

.SetChange(BitcoinAddress.Create(changeAddress, currencyNetwork))

.SendFees(Money.Satoshis(blockchainFee))

.BuildTransaction(sign: true);

if (builder.Verify(signedTx, out errors))

{

var signedTxHex = signedTx.ToHex();

var txHash = await BroadcastTransactionAsync(signedTxHex);

return txHash;

}

}

For Utxo based coins we try to use the NBitcoin library, it provides almost all the functionality we need for offline creation and signing of transactions.And for broadcasting transactions we use a SendRawTransactionAsync method from NBitcoin library which returns uint256 which we convert to string


Generate key

Output: string private key or KeyPair(public and private key)

Note: You need to generate what is needed to create an Address and sign transactions

Examples:


General purpose bip44 extended key (using NBitcoin library):

var network = Network.Main;

var key = new ExtKey();

var privKeyStr = key.ToString(network);

For Ethereum(using Nethereum.Signer library):

var keyPair = EthECKey.GenerateKey();

var privKeyStr = keyPair.GetPrivateKey();

Create Address from derived public key

Input: byte[] pubKey

Output: string Address

Examples:

For Bitcoin(using NBitcoin library):

private static string CreateBtcAddressFromDerivedPubkey(byte[] pubkey)

{

var network = Network.Main;

var key = new PubKey(pubkey)

return key.GetAddress(ScriptPubKeyType.SegwitP2SH, network).ToString();

}

For Ethereum(using Nethereum.Signer library):

private static string CreateEthereumAddressFromDerivedPubkey(byte[] pubkey)

{

var ethKey = new Nethereum.Signer.EthECKey(pubkey, isPrivate: false);

return ethKey.GetPublicAddress().ToLower();

}

Get all transaction from Block/Ledger etc.

Input: ulong index(The block number from which we want to get all transactions) or string blockHash
Output:
The specific type, different for each coin, must include the sender's, recipient's address and the amount of coins sent.

Examples:

For Bitcoin:

public virtual async Task<BlockResponseV2> GetBlockWithTransactionsByHashAsync(uint256 blockHash)

{

var response = await SendCommandAsync

(RPCOperations.getblock, blockHash, (int)BlockResponseFormat.JsonWithTransactions);

var blockJson = response.ResultString;

var block = JsonSerializer.Deserialize<BlockResponse>(blockJson);

return block;

}

For Ethereum:

public async Task<BlockWithTransactions?> GetBlockWithTransactionsAsync(ulong blockHeight)

{

object[] _params = new object[2]

{

blockHeight.ToString(),

true

};

var response = await PostAsJsonAsync(_baseUrl, new EthereumJsonRpcRequest()

{

id = 1,

jsonrpc = "2.0",

method = "eth_getBlockByNumber",

_params = _params

});

var block = JsonSerializer.Deserialize<BlockResponseEthereum>(response);

return block;

}

Get Blockchain Address Balance(for account-based coins and for tokens)

Input: string address

Output: decimal balance

Example for Ethereum:

public async Task<decimal> GetEthBalance(string address)

{

object[] _params = new object[1]

{

address

};

var response = await PostAsJsonAsync(_baseUrl, new EthereumJsonRpcRequest()

{

id = 1,

jsonrpc = "2.0",

method = "eth_getBalance",

_params = _params

});

var result = JsonSerializer.Deserialize<EthereumCallResponse>(response);

return (decimal)new HexBigInteger(result.result).Value;

}

Get idempotence data

Input: string address

Output: string data

Example for Ethereum:

public async Task<HexBigInteger> GetTransactionCountAsync(string address)

{

object[] _params = new object[1]

{

address

};

var response = await PostAsJsonAsync(_baseUrl, new EthereumJsonRpcRequest()

{

id = 1,

jsonrpc = "2.0",

method = "eth_getTransactionCount",

_params = _params

});

var callResponse = JsonSerializer.Deserialize<EthereumCallResponse>(response);

var count = new HexBigInteger(callResponse.result);

return count;

}

ValidateTransfer

Task<bool> ValidateTransfer(string toAddress, decimal amountInSmalletUnits);

Input: string toAddress, amountInSmalletUnits

Output: true/false

For example: If the Ripple account is not activated, the transaction amount must be 20 or more, otherwise the transaction will fail

Is Tx Successful

Some coins have several results of a broadcast transaction, for example Ripple has about 3 types of responses when the transaction is successful, and about 10 responses of a failed transaction, in such cases we must distinguish it.
Please specify successful status and rebroadcast status for each coin

- \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d41b8bd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Ivan Goncharov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a8de8cd --- /dev/null +++ b/README.md @@ -0,0 +1,258 @@ +# OpenAPI Definition Starter + +## How to use this starter + +![Click use template button](https://user-images.githubusercontent.com/3975738/92927304-12e35d80-f446-11ea-9bd3-a0f8a69792d0.png) + +## Working on your OpenAPI Definition + +### Install + +1. Install [Node JS](https://nodejs.org/). +2. Clone this repo and run `npm install` in the repo root. + +### Usage + +#### `npm start` +Starts the reference docs preview server. + +#### `npm run build` +Bundles the definition to the dist folder. + +#### `npm test` +Validates the definition. + +## Contribution Guide + +Below is a sample contribution guide. The tools +in the repository don't restrict you to any +specific structure. Adjust the contribution guide +to match your own structure. However, if you +don't have a structure in mind, this is a +good place to start. + +Update this contribution guide if you +adjust the file/folder organization. + +The `.redocly.yaml` controls settings for various +tools including the lint tool and the reference +docs engine. Open it to find examples and +[read the docs](https://redocly.com/docs/cli/configuration/) +for more information. + + +### Schemas + +#### Adding Schemas + +1. Navigate to the `openapi/components/schemas` folder. +2. Add a file named as you wish to name the schema. +3. Define the schema. +4. Refer to the schema using the `$ref` (see example below). + +##### Example Schema +This is a very simple schema example: +```yaml +type: string +description: The resource ID. Defaults to UUID v4 +maxLength: 50 +example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 +``` +This is a more complex schema example: +```yaml +type: object +properties: + id: + description: The customer identifier string + readOnly: true + allOf: + - $ref: ./ResourceId.yaml + websiteId: + description: The website's ID + allOf: + - $ref: ./ResourceId.yaml + paymentToken: + type: string + writeOnly: true + description: | + A write-only payment token; if supplied, it will be converted into a + payment instrument and be set as the `defaultPaymentInstrument`. The + value of this property will override the `defaultPaymentInstrument` + in the case that both are supplied. The token may only be used once + before it is expired. + defaultPaymentInstrument: + $ref: ./PaymentInstrument.yaml + createdTime: + description: The customer created time + allOf: + - $ref: ./ServerTimestamp.yaml + updatedTime: + description: The customer updated time + allOf: + - $ref: ./ServerTimestamp.yaml + tags: + description: A list of customer's tags + readOnly: true + type: array + items: + $ref: ./Tags/Tag.yaml + revision: + description: > + The number of times the customer data has been modified. + + The revision is useful when analyzing webhook data to determine if the + change takes precedence over the current representation. + type: integer + readOnly: true + _links: + type: array + description: The links related to resource + readOnly: true + minItems: 3 + items: + anyOf: + - $ref: ./Links/SelfLink.yaml + - $ref: ./Links/NotesLink.yaml + - $ref: ./Links/DefaultPaymentInstrumentLink.yaml + - $ref: ./Links/LeadSourceLink.yaml + - $ref: ./Links/WebsiteLink.yaml + _embedded: + type: array + description: >- + Any embedded objects available that are requested by the `expand` + querystring parameter. + readOnly: true + minItems: 1 + items: + anyOf: + - $ref: ./Embeds/LeadSourceEmbed.yaml + +``` + +If you have an JSON example, you can convert it to JSON schema using Redocly's [JSON to JSON schema tool](https://redocly.com/tools/json-to-json-schema/). + +##### Using the `$ref` + +Notice in the complex example above the schema definition itself has `$ref` links to other schemas defined. + +Here is a small excerpt with an example: + +```yaml +defaultPaymentInstrument: + $ref: ./PaymentInstrument.yaml +``` + +The value of the `$ref` is the path to the other schema definition. + +You may use `$ref`s to compose schema from other existing schema to avoid duplication. + +You will use `$ref`s to reference schema from your path definitions. + +#### Editing Schemas + +1. Navigate to the `openapi/components/schemas` folder. +2. Open the file you wish to edit. +3. Edit. + +### Paths + +#### Adding a Path + +1. Navigate to the `openapi/paths` folder. +2. Add a new YAML file named like your URL endpoint except replacing `/` with `_` (or whichever character you prefer) and putting path parameters into curly braces like `{example}`. +3. Add the path and a ref to it inside of your `openapi.yaml` file inside of the `openapi` folder. + +Example addition to the `openapi.yaml` file: +```yaml +'/customers/{id}': + $ref: './paths/customers_{id}.yaml' +``` + +Here is an example of a YAML file named `customers_{id}.yaml` in the `paths` folder: + +```yaml +get: + tags: + - Customers + summary: Retrieve a list of customers + operationId: GetCustomerCollection + description: | + You can have a markdown description here. + parameters: + - $ref: ../components/parameters/collectionLimit.yaml + - $ref: ../components/parameters/collectionOffset.yaml + - $ref: ../components/parameters/collectionFilter.yaml + - $ref: ../components/parameters/collectionQuery.yaml + - $ref: ../components/parameters/collectionExpand.yaml + - $ref: ../components/parameters/collectionFields.yaml + responses: + '200': + description: A list of Customers was retrieved successfully + headers: + Rate-Limit-Limit: + $ref: ../components/headers/Rate-Limit-Limit.yaml + Rate-Limit-Remaining: + $ref: ../components/headers/Rate-Limit-Remaining.yaml + Rate-Limit-Reset: + $ref: ../components/headers/Rate-Limit-Reset.yaml + Pagination-Total: + $ref: ../components/headers/Pagination-Total.yaml + Pagination-Limit: + $ref: ../components/headers/Pagination-Limit.yaml + Pagination-Offset: + $ref: ../components/headers/Pagination-Offset.yaml + content: + application/json: + schema: + type: array + items: + $ref: ../components/schemas/Customer.yaml + text/csv: + schema: + type: array + items: + $ref: ../components/schemas/Customer.yaml + '401': + $ref: ../components/responses/AccessForbidden.yaml + x-code-samples: + - lang: PHP + source: + $ref: ../code_samples/PHP/customers/get.php +post: + tags: + - Customers + summary: Create a customer (without an ID) + operationId: PostCustomer + description: Another markdown description here. + requestBody: + $ref: ../components/requestBodies/Customer.yaml + responses: + '201': + $ref: ../components/responses/Customer.yaml + '401': + $ref: ../components/responses/AccessForbidden.yaml + '409': + $ref: ../components/responses/Conflict.yaml + '422': + $ref: ../components/responses/InvalidDataError.yaml + x-code-samples: + - lang: PHP + source: + $ref: ../code_samples/PHP/customers/post.php +``` + +You'll see extensive usage of `$ref`s in this example to different types of components including schemas. + +You'll also notice `$ref`s to code samples. + +### Code samples + +Automated code sample generations is enabled in the Redocly configuration file. Add manual code samples by the following process: + +1. Navigate to the `openapi/code_samples` folder. +2. Navigate to the `` (e.g. PHP) sub-folder. +3. Navigate to the `path` folder, and add ref to the code sample. + +You can add languages by adding new folders at the appropriate path level. + +More details inside the `code_samples` folder README. diff --git a/add-API-section.js b/add-API-section.js deleted file mode 100644 index 3bd8dcb..0000000 --- a/add-API-section.js +++ /dev/null @@ -1,64 +0,0 @@ -var $ = document.querySelector.bind(document); -$("img").parentElement.style.setProperty('padding', '7%'); - -function createElementFromHTML(htmlString) { - var div = document.createElement('div'); - div.innerHTML = htmlString.trim(); - return div.firstChild; -} - -setTimeout(function () { - var tabHtml = '
  • '; - - var tutorialsHtml = `
    -
    -
    -

    Authentication

    -

    Old version

    -

    The old API uses a SHA-512 HMAC signature generated with your private key. But the new one uses a HmacSHA-256 instead. Our server generates it's own HMAC signature and compares it with the API caller's. If they don't match the API call is discarded. The HMAC signature then encodes with Base64 schemes and is sent as a HTTP header called 'X-CoinPayments-Signature'. -Also you should add two new headers. One of them is '"X-CoinPayments-Timestamp' with current date converting to a string, according to universal time. Another header is called 'X-CoinPayments-Client' preserving information about your clientId. -The HMAC signature is created from the request method, request url, clientId, date and request body. For example if your API secret key was "test" and public key was "your_api_public_key" (both without quotes) and you would like to send request to /api/v1/merchant/callbacks the text for generating HMAC might look like:

    - - GET https://api.coinpayments.net/api/v1/merchant/callbacks7aa5e7ba45d84d978c5ea7f62498abf4Mon, 02 Nov 2020 12:16:38 GMT - -
    -
    -

    and the hash in Base64 would be:

    - - Gpv0yNiv4zWHukg5peVCPcYTCSVzH6t9QFLzF2Rq49E= - -

    Requests example

    -

    Old Version

    -

    For getting callback using old API you have to send HTTP request(POST) https://www.coinpayments.net/api.php/ - with such a x-www-form-urlencoded body: -

      -
    • version: 1
    • -
    • cmd: get_callback_address
    • -
    • key: 3765ac71c95e08887f4077e0989bd142ad7c6d818af4353f6452f0eb945bf82b
    • -
    • currency: BTC
    • - -
    -

    New version

    -

    For list all callback addresses sorted descending by the creation date using new API we'll send HTTP request(GET) to /api/v1/merchant/callbacks with parameters:

    -
      -
    • clientId - The merchant client id whose callback address should be listed
    • -
    • currencyId - The id of the currency the address was receiving
    • -
    • after -
    • -
    • limit -
    • -
    -

    -
    -
    -
    -`; - var contentHtml = `

    Migrating from the old API to the new one

    ${tutorialsHtml}
    `; - - var tablist = $("#tabs-list"); - tablist.insertBefore(createElementFromHTML(tabHtml), tablist.firstChild); - tablist.firstChild.firstChild.addEventListener('click', function () { window.location.hash = "#section/Migrating"; }); - window.location.hash = "#section/Migrating"; - - var apiContent = $("#apiContent") - apiContent.insertBefore(createElementFromHTML(contentHtml), apiContent.firstChild.nextSibling); - -}, 1000); \ No newline at end of file diff --git a/add-authentication-section.js b/add-authentication-section.js deleted file mode 100644 index 0793aaa..0000000 --- a/add-authentication-section.js +++ /dev/null @@ -1,191 +0,0 @@ -var $ = document.querySelector.bind(document); -$("img").parentElement.style.setProperty('padding', '7%'); - -function createElementFromHTML(htmlString) { - var div = document.createElement('div'); - div.innerHTML = htmlString.trim(); - return div.firstChild; -} - -setTimeout(function () { - var tabHtml = '
  • '; - - var tutorialsHtml = ` -
    -
    -

    Examples of using Client Id and Client Secret:

    -

    Python example:

    -
    -
    -
    -                            
    -import http.client
    -import json
    -import email.utils
    -import hashlib
    -import base64
    -import hmac
    -
    -conn = http.client.HTTPSConnection( "api.coinpayments.net")
    -payload = json.dumps({})
    -clientId =  "ce765439c6bd426b8533b2d5dbf731ba";
    -clientSecret =  "F42L8rx9wHYz4Bhiz/vuYnrZgKLTTAbP0gosH87sY3g=";
    -date = email.utils.formatdate(usegmt=True)
    -text =  "GET" +  "https://api.coinpayments.net" +  "/api/v1/merchant/wallets" + clientId + date + payload
    -text =  '\\ufeff'+text
    -text = text.encode('utf-8')
    -clientSecret = clientSecret.encode('utf-8')
    -signature = base64.b64encode(hmac.new(clientSecret, text, digestmod=hashlib.sha256).digest())
    -headers = {
    -   'Content-Type':  'application/json',
    -   'X-CoinPayments-Client': clientId,
    -   'X-CoinPayments-Timestamp': date,
    -   'X-CoinPayments-Signature': signature
    -}
    -conn.request( "GET",  "/api/v1/merchant/wallets", payload, headers)
    -res = conn.getresponse()
    -data = res.read()
    -print(data.decode( "utf-8"))
    -                    
    -                  
    -
    -
    -
    -

    JavaScript example:

    -
    -
    -
    -                            
    -var requestOptions = {
    -    method:  'GET',
    -    redirect:  'follow',
    -};
    -
    -var headers = new Headers();
    -headers.append(  'Content-Type',  'application/json');
    -
    -var clientId =  "ce765439c6bd426b8533b2d5dbf731ba";
    -var clientKey =  "F42L8rx9wHYz4Bhiz/vuYnrZgKLTTAbP0gosH87sY3g=";
    -headers.append( "X-CoinPayments-Client", clientId);
    -var date = new Date().toUTCString();
    -headers.append( "X-CoinPayments-Timestamp", date);
    -
    -var url =  "https://api.coinpayments.net/api/v1/merchant/wallets";
    -var text = requestOptions.method + url + clientId + date;
    -var hash = CryptoJS.HmacSHA256( "\\ufeff" + text, clientKey);
    -var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
    -headers.append( "X-CoinPayments-Signature", hashInBase64);
    -requestOptions.headers=headers;
    -fetch(url, requestOptions)
    -     .then(response => response.text())
    -     .then(result => console.log(result))
    -     .catch(error => console.log( 'error', error));
    -                    
    -                  
    -
    -
    -

    PHP example:

    -
    -
    -
    -                            
    -$curl = curl_init();
    -$method =  'GET';
    -$apiUrl =  'https://api.coinpayments.net/api/v1/merchant/wallets';
    -$date = new \\Datetime();
    -$params = null;
    -$clientId =  "ce765439c6bd426b8533b2d5dbf731ba";
    -$clientSecret =  "F42L8rx9wHYz4Bhiz/vuYnrZgKLTTAbP0gosH87sY3g=";
    -$signatureString = implode( '', [
    -    chr(239),
    -    chr(187),
    -    chr(191),
    -    $method,
    -    $apiUrl,
    -    $clientId,
    -    $date->format( 'c'),
    -    $params
    -]);
    -$signature = base64_encode(hash_hmac( 'sha256', $signatureString, $clientSecret, true));
    -
    -$headers = [
    -     'Content-Type: application/json',
    -     'X-CoinPayments-Client: ' . $clientId,
    -     'X-CoinPayments-Timestamp: ' . $date->format( 'c'),
    -     'X-CoinPayments-Signature: ' . $signature,
    -];
    -
    -$options = [
    -    CURLOPT_RETURNTRANSFER => true,
    -    CURLOPT_HEADER => true,
    -    CURLOPT_SSL_VERIFYHOST => 0,
    -    CURLOPT_SSL_VERIFYPEER => 0,
    -    CURLOPT_URL => $apiUrl,
    -    CURLOPT_HTTPHEADER => $headers,
    -];
    -
    -
    -curl_setopt_array($curl, $options);
    -
    -$response = curl_exec($curl);
    -curl_close($curl);
    -                    
    -                  
    -
    -
    -

    C# example:

    -
    -
    -
    -                            
    -using System;
    -using System.Text;
    -using RestSharp;
    -
    -namespace c_example
    -{
    -
    -    class Program
    -    {
    -        static void Main(string[] args)
    -        {
    -            var client = new RestClient( "https://api.coinpayments.net/api/v1/merchant/wallets");
    -            client.Timeout = -1;
    -            var request = new RestRequest(Method.GET);
    -            request.AddHeader( "Content-Type",  "application/json");
    -
    -            var clientId =  "ce765439c6bd426b8533b2d5dbf731ba";
    -            var clientSecret =  "F42L8rx9wHYz4Bhiz/vuYnrZgKLTTAbP0gosH87sY3g=";
    -            request.AddHeader( "X-CoinPayments-Client", clientId);
    -            
    -            DateTime date = DateTime.UtcNow;
    -            var date_utc = date.ToString( "r");
    -            request.AddHeader( "X-CoinPayments-Timestamp", date_utc);
    -
    -            var text = request.Method +  "" + client.BaseUrl + clientId + date_utc;
    -            var provider = new System.Security.Cryptography.HMACSHA256(Encoding.UTF8.GetBytes(clientSecret));
    -            var hash = provider.ComputeHash(Encoding.UTF8.GetBytes( "\\ufeff" + text));
    -            var signature = Convert.ToBase64String(hash);
    -            request.AddHeader( "X-CoinPayments-Signature", signature);
    -
    -            IRestResponse response = client.Execute(request);
    -            Console.WriteLine(response.Content);
    -        }
    -    }
    -}
    -                    
    -                  
    -
    -
    -`; - var contentHtml = `

    Examples of using Client Id and Client Secret

    ${tutorialsHtml}
    `; - - var tablist = $("#tabs-list"); - tablist.insertBefore(createElementFromHTML(tabHtml), tablist.firstChild); - tablist.firstChild.firstChild.addEventListener('click', function () { window.location.hash = "#section/Examples of using Client Id and Client Secret"; }); - window.location.hash = "#section/Examples of using Client Id and Client Secret"; - - var apiContent = $("#apiContent") - apiContent.insertBefore(createElementFromHTML(contentHtml), apiContent.firstChild.nextSibling); - -}, 1000); \ No newline at end of file diff --git a/add-custom-button-section.js b/add-custom-button-section.js deleted file mode 100644 index 3f5f4e0..0000000 --- a/add-custom-button-section.js +++ /dev/null @@ -1,531 +0,0 @@ -var $ = document.querySelector.bind(document); -$("img").parentElement.style.setProperty('padding', '7%'); - -function createElementFromHTML(htmlString) { - var div = document.createElement('div'); - div.innerHTML = htmlString.trim(); - return div.firstChild; -} - -setTimeout(function () { - var tabHtml = '
  • '; - - var tutorialsHtml = ` - -
    -
    -
    -
    -
    -

    Include JavaScript SDK

    -

    - This integration uses the CoinPayments JavaScript SDK to integrate the Payment button into your site without any server side code. -

    -

    - Add the CoinPayments JavaScript SDK <script> tag to your page <head> or <body> section as shown in the example. -

    -
    -
    -
    -
    
    -  <html>
    -    <head>
    -      <script src="https://checkout.coinpayments.net/static/js/checkout.js"></script>
    -    </head>
    -    <body>
    -      <!-- ... -->
    -    </body>
    -  </html>
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Simple Button

    -

    - Creates a simple CoinPayments button which upon clicking creates an invoice for $1.23 USD and renders the button into a <div> on the page. -

    -

    - Note: These samples use client side integration calling the CoinPayments API directly, the createInvoice method can just as well make a call to your server, it just needs to return a Promise<string> that resolves to the CoinPayments invoice id. -

    -
    -
    -
    -
    
    -  CoinPayments.Button({
    -
    -    //
    -    // the \`createInvoice\` method is called when the user presses the
    -    // Pay with CoinPayments button.
    -    //
    -
    -    createInvoice: async function (data, actions) {
    -      const invoiceId = await actions.invoice.create({
    -        clientId: "CoinPaymentsDemoClient",
    -        amount: {
    -          currencyId: "5057",    // USD
    -          value: "123"           // $ 1.23 USD  (123 cents)
    -        },
    -        requireBuyerNameAndEmail: true,
    -        buyerDataCollectionMessage: "Your email and name is collected for customer service purposes such as order fulfillment."
    -      });
    -      return invoiceId;
    -    }
    -
    -    //
    -    // the button is rendered into a div with id \`cps-button-container-1\`
    -    //
    -
    -  }).render("cps-button-container-1");
    -
    -
    -
    -
    -
    -
    -

    Try it out

    -
    -
    -
    -
    -
    -
    -
    -
    -

    Customized Style

    -

    - The color and style of the button can be customized by specifying an additional style object. The available colours are white (default), black and blue. Optionally a width can also be specified, if not provided then the button defaults to 225 pixels wide. -

    -
    -
    -
    -
    
    -  CoinPayments.Button({
    -    style: {
    -      color: "blue",
    -      width: 180
    -    },
    -    createInvoice: function (data, actions) {
    -      // ... see above
    -    }
    -  }).render("cps-button-container-2");
    -
    -
    -
    -
    -
    -
    -

    Try it out

    -
    -
    -
    -
    -
    -
    -
    -
    -

    Items and details

    -

    - Additional details about the invoice can be provided and they'll appear on the checkout screens and your dashboard. See the documentation for a full definition of all the properties accepted by the invoice.create method. -

    -

    - Note: When a breakdown and additional prices are specified they must add up to the invoice total. The subtotal must be the sum of the items amounts and the total the sum of all amounts in the breakdown. -

    -

    - Note: The currencyId can be specified at the level of the invoice, then all monetary amounts are assumed to be in that currency. -

    -
    -
    -
    -
    
    -      {
    -        clientId: "CoinPaymentsDemoClient",
    -        currencyId: "5057",  // USD
    -        items: [
    -        {
    -          name: "First test item in the cart",
    -          description: "this is a description of the first test item",
    -          quantity: {
    -            value: "1",
    -            type: "1"
    -          },
    -          amount: "1000"    // $ 10.00 USD
    -        },
    -        {
    -          name: "There are two of these items",
    -          description: "this is the second item in the shopping cart",
    -          quantity: {
    -            value: "2",
    -            type: "1"
    -          },
    -          amount: "1234"    // $ 12.34 USD
    -        }
    -        ],
    -        amount: {
    -          breakdown: {
    -            subtotal: "2234", // $ 22.34 USD (items 10.00 + 12.34)
    -            shipping: "999",  // $ 9.99 USD
    -            handling: "100",  // $ 1.00 USD
    -            taxTotal: "500"   // $ 5.00 USD
    -          },
    -          value: "3833"       // $ 31.33 USD total
    -        }
    -      }
    -
    -
    -
    -
    -
    -
    -

    Try it out

    -
    -
    -
    -
    -
    -
    -
    -
    -

    Callbacks

    -

    - Implement the onConfirmed method which is called after the invoice has been paid and the payments confirmed on the blockchain. - You'll want to validate the payment here on the server side before completing the order in your system. -

    -

    - Likewise implement the onCancelled method which is called when the invoice payment is cancelled. For example by the user closing - the payment window or the invoice expiring before payment is completed. -

    -

    - Note: You can specify the invoiceId and a customData dictionary of strings to store additional data along with the - invoice. These can help with correlating and validating the invoice in your system. -

    -

    - Note: You must validate the invoice data on server-side, client-side only validation is NOT safe. - For example, in the onConfirmed method make an AJAX call to your backend to verify the invoice server-side. - Validate that the invoiceId and amount match the expected values before completing the order on your side. -

    -
    -
    -
    -
    
    -      CoinPayments.Button({
    -    
    -        //
    -        // you can specify the \`invoiceId\` and \`customData\` dictionary of strings to store
    -        // along with the invoice so that you can correlate the invoice in your system
    -        //
    -    
    -        createInvoice: async function (data, actions) {
    -          const invoiceId = await actions.invoice.create({
    -            clientId: "CoinPaymentsDemoClient",
    -            invoiceId: "YOUR_CUSTOM_INVOICE_ID",   // your internal invoice ID
    -            customData: {
    -              foo: "bar",
    -              hello: "world"
    -            },
    -            amount: {
    -              currencyId: "5057",     // USD
    -              value: "123"            // $ 1.23 USD  (123 cents)
    -            }
    -          });
    -          return invoiceId;
    -        },
    -        onConfirmed(data) {
    -          // called when the invoice is paid and confirmed on the blockchain
    -          // the payments may not yet have been transferred to your wallets
    -          alert("Invoice confirmed: " + data.invoiceId);
    -        },
    -        onCancelled(data) {
    -          // called when the invoice is cancelled and can no longer be paid
    -          // e.g. user closes the payment window or timeout expires
    -          alert("Invoice cancelled: " + data.invoiceId);
    -        }
    -      }).render("cps-button-container-4");
    -    
    -
    -
    -
    -
    -
    -
    -

    Try it out

    -
    -
    -
    -
    -
    -
    -
    -
    -

    Webhooks (IPN)

    -

    - Webhook Instant Payment Notifications (IPNs) are sent at various stages of an invoices life-cycle. For example when an invoice is created, paid and confirmed on the blockchain. -

    -

    - Webhook notification endpoints can be configured in your merchant dashboard and are implemented as POST requests to those endpoints with a JSON body of - the invoice and payment details. -

    -

    - Note: all webhook notifications include a X-CoinPayments-Signature header that contains the HMAC SHA256 hash of the message body signed with your app secret. - You MUST verify the signature to ensure that the notification has not been tampered with. -

    -

    - Note: webhook notifications will be retried up to 10 times if your server responds with an error code and may arrive out of order. -

    -
    - -
    -
    -
    -

    infoClick "Pay with CoinPayments"

    -

    infoWebhook IPN notifications will show here

    -
    -
    -
    -
    -
    -
    -
    -

    Try it out

    -
    -
    -
    -
    -`; - var contentHtml = `

    Custom Buttons

    ${tutorialsHtml}
    `; - - - var tablist = $("#tabs-list"); - tablist.insertBefore(createElementFromHTML(tabHtml), tablist.firstChild); - tablist.firstChild.firstChild.addEventListener('click', function () { window.location.hash = "#section/CustomButtons"; }); - window.location.hash = "#section/CustomButtons"; - - var apiContent = $("#apiContent") - apiContent.insertBefore(createElementFromHTML(contentHtml), apiContent.firstChild.nextSibling); -},1) - -setTimeout(function () { - CoinPayments.Button({ - createInvoice: function (data, actions) { - return actions.invoice.create({ - clientId: "CoinPaymentsDemoClient", - amount: - { - currencyId: "5057", // USD - value: "123" // $ 1.23 USD - }, - requireBuyerNameAndEmail: true, - buyerDataCollectionMessage: "Your email and name is collected for customer service purposes such as order fulfillment." - }); - } - }).render("cps-button-container-1"); - - CoinPayments.Button({ - style: { - color: "blue", - width: 180 - }, - createInvoice: function (data, actions) { - return actions.invoice.create({ - clientId: "CoinPaymentsDemoClient", - amount: - { - currencyId: "4341", // CAD - value: "1000" // $ 10.00 CAD - } - }); - } - }).render("cps-button-container-2"); - - CoinPayments.Button({ - style: { - color: "black" - }, - createInvoice: function (data, actions) { - return actions.invoice.create({ - clientId: "CoinPaymentsDemoClient", - currencyId: 5057, - items: [ - { - name: "First test item in the cart", - description: "this is a description of the first test item", - quantity: { - value: "1", - type: "1" - }, - amount: "1000" // $ 10.00 USD - }, - { - name: "There are two of these items", - description: "this is the second item in the shopping cart", - quantity: { - value: "2", - type: "1" - }, - amount: "1234" // $ 12.34 USD - } - ], - amount: { - breakdown: { - subtotal: "2234", // $ 22.34 USD (items 10.00 + 12.34) - shipping: "999", // $ 9.99 USD - handling: "100", // $ 1.00 USD - taxTotal: "500" // $ 5.00 USD - }, - value: "3833" // $ 31.33 USD total - } - }); - } - }).render("cps-button-container-3"); - - CoinPayments.Button({ - createInvoice: function (data, actions) { - return actions.invoice.create({ - clientId: "CoinPaymentsDemoClient", - amount: - { - currencyId: "5057", // USD - value: "123" // $ 1.23 USD - } - }); - }, - onConfirmed(data) { - // called when the invoice is paid and confirmed on the blockchain - // the payments may not yet have been transferred to your wallets - alert("Invoice confirmed: " + data.invoiceId); - }, - onCancelled(data) { - // called when the invoice is cancelled and can no longer be paid - alert("Invoice cancelled: " + data.invoiceId); - } - }).render("cps-button-container-4"); - - var webhookSignalRConnectionId = null; - - function getWebhookSignalRConnectionIdAsync() { - if (!webhookSignalRConnectionId) { - return Promise.resolve(webhookSignalRConnectionId); - } - - var connection = new signalR.HubConnectionBuilder() - .withUrl("/api/v1/hubs/checkout-demo") - .build(); - - return connection.start().then(function() { - connection.on("ipn", function(body) { - console.log(body); - - var parsed = JSON.parse(body); - - writeWebhookLog({ - logLevel: "info", - category: "IPN", - eventId: { - id: parsed.id, - name: parsed.type - }, - message: body - }); - }); - - return connection.invoke("GetConnectionId").then(function (id) { - return webhookSignalRConnectionId = id; - }); - }); - } - - CoinPayments.Button({ - style: { - color: "blue" - }, - createInvoice: function (data, actions) { - return getWebhookSignalRConnectionIdAsync().then(function(id) { - return actions.invoice.create({ - clientId: "CoinPaymentsDemoClient", - customData: { - demoId: id - }, - amount: - { - currencyId: "5057", // USD - value: "242" // $ 2.42 USD - } - }); - }); - } - }).render("cps-button-container-5"); - - document.getElementById("script-site-origin").innerText = window.location.origin.toString(); - - function getLogLevelColor(logLevel) { - switch (logLevel) { - case "dbug": - return { f: "gray", b: "black" }; - case "info": - return { f: "#73e68c", b: "black" }; - case "warn": - return { f: "#fefb84", b: "black" }; - case "fail": - return { f: "black", b: "#ff6673" }; - case "crit": - return { f: "white", b: "red" }; - default: - return { f: "lightgray", b: "black" }; - } - } - - function writeWebhookLog(log) { - var heading = document.createElement("p"); - var message = document.createElement("p"); - - var levelSpan = document.createElement("span"); - var categorySpan = document.createElement("span"); - var levelColor = getLogLevelColor(log.logLevel); - - levelSpan.innerText = log.logLevel; - levelSpan.style.color = levelColor.f; - levelSpan.style.background = levelColor.b; - levelSpan.className = "log-level"; - - var eventId = (log.eventId && log.eventId.id) || ""; - var eventName = log.eventId && log.eventId.name; - - categorySpan.innerText = (log.category || "") + (eventId || eventName) ? ("[" + eventId + (eventName ? (", " + eventName) : "") + "]") : ""; - categorySpan.className = "log-category"; - - message.innerHTML = log.message.replace(/(?:\r\n|\r|\n)/g, '
    ').replace(/ /g, ' '); - message.className = "log-message"; - - heading.className = "log-heading"; - heading.appendChild(levelSpan); - - if (log.category || eventId || eventName) { - heading.appendChild(categorySpan); - } - - var messageList = document.getElementById("webhooks-log"); - - messageList.appendChild(heading); - messageList.appendChild(message); - - if (log.exception) { - var ex = document.createElement("p"); - ex.innerText = log.exception; - ex.className = "log-exception"; - messageList.appendChild(ex); - } - - while (messageList.childNodes.length > 3000) { - var child = messageList.childNodes.item(0); - messageList.removeChild(child); - } - - var container = document.getElementById("webhooks-log-container"); - container.scrollTop = container.scrollHeight; - }},3000); \ No newline at end of file diff --git a/add-tutorial-section.js b/add-tutorial-section.js deleted file mode 100644 index dbecde0..0000000 --- a/add-tutorial-section.js +++ /dev/null @@ -1,952 +0,0 @@ - var $ = document.querySelector.bind(document); - $("img").parentElement.style.setProperty('padding', '7%'); - - function createElementFromHTML(htmlString) { - var div = document.createElement('div'); - div.innerHTML = htmlString.trim(); - return div.firstChild; - } - - setTimeout(function () { - var tabHtml = '
  • '; - - var tutorialsHtml = `
    -
    -
    -

    Use Case Tutorials

    -

    The following are a collection of potential use cases for the CoinPayments API with example steps for integration.

    -

    Prerequisites for tutorials

    -
      -
    • A CoinPayments.net account.
    • -
    • A platform capable of making HTTP calls to the CoinPayments.net API.
    • -
    • Developer understanding of the introduction documentation section for the CoinPayments.net API.
    • -
    • A private and public API key (from this logged in account page).
    • -
    • Knowledge of the different coin codes, listed in the CODE column on the supported coins page. These codes (also known as tickers) are used in the API calls anytime a "currency", "to" or "from" field is needed.
    • -
    -

    Note: These tutorials assume every HTTP request executing on https://alpha.coinpayments.net/ and he will be skipped in examples. Also, assume so every API response format to be the default format of JSON.

    -

    Tutorial 1: E-Commerce System Checkout

    -

    This tutorial will cover integrating the following features using the CoinPayments.net API:

    -
      -
    • Get a list of available currencies
    • -
    • Returns the currency conversion rates for the specified from currencies converted to the specified to currencies
    • -
    • Be notified of a completed payment by the IPN system.
    • -
    -

    Part A: Get a list of available currencies

    -

    For getting all available currencies we'll send an HTTP request (GET) to /api/v1/currencies.
    - The response will contain information about all available currencies.
    - Currency information looks like

    -
    {
    -     "id": 1,
    -     "type": "crypto",
    -     "symbol": "BTC",
    -     "name": "Bitcoin",
    -     "logo": {
    -        "imageUrl": "https://api.coinpayments.net/static/img/coins/64x64/1.png",
    -        "vectorUrl": "https://api.coinpayments.net/static/img/coins/vector/1.svg"
    -     },
    -     "decimalPlaces": 8,
    -     "rank": 1,
    -     "status": "active",
    -     "capabilities":
    -     [
    -        "multiSigAccounts",
    -        "singleSigAccounts"
    -     ],
    -     "urls": {
    -        "websites":
    -        [
    -           "https://bitcoin.org"
    -        ],
    -        "explorers":
    -        [
    -           "https://blockchain.info"
    -        ]
    -     }
    -  }
    -  
    -

    Part B: The currency conversion rates

    -

    For check rate between currencies, we'll send the HTTP request (GET) to /api/v1/rates?from=1&to=5057
    - query param explanation:

    - - - - - - - - - - - - - - - - - -
    ParameterDescription
    fromcurrency id to use as the source for rate calculations
    tocomma separated list of currency ids for which to retrieve conversion rates for (from the from currencies)
    -

    The response will be looks like

    -
    {
    -    "items": [
    -      {
    -        "baseCurrencyId": 1,
    -        "quoteCurrencyId": 5057,
    -        "rate": "8896.619359154478102279714028"
    -      }
    -    ]
    -  }
    -  
    -

    Part C: Checkout

    -

    The next example explains how to create a payment using the CoinPayments.net API in order to accept payment in your e-commerce system during the checkout process. You will need to know the following information in order to create the payment:

    -
      -
    • The total price that you wish to charge for the payment.
    • -
    • Buyer personal data (name, email, phone, etc)
    • -
    -

    For creating new payment we will send HTTP request (POST) to /api/v1/invoices. The request body should look like

    -
    {
    -    "clientId": "string",
    -    "currencyId": 0,
    -    "invoiceId": "string",
    -    "buyer": {
    -      "companyName": "string",
    -      "name": {
    -        "firstName": "string",
    -        "lastName": "string"
    -      },
    -      "emailAddress": "user@example.com",
    -      "phoneNumber": "string",
    -      "address": {
    -        "address1": "string",
    -        "address2": "string",
    -        "address3": "string",
    -        "provinceOrState": "string",
    -        "city": "string",
    -        "suburbOrDistrict": "string",
    -        "countryCode": "string",
    -        "postalCode": "string"
    -      }
    -    },
    -    "description": "string",
    -    "items": [
    -      {
    -        "customId": "string",
    -        "sku": "string",
    -        "name": "string",
    -        "description": "string",
    -        "quantity": 0,
    -        "originalAmount": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "amount": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "tax": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        }
    -      }
    -    ],
    -    "amount": {
    -      "breakdown": {
    -        "subtotal": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "shipping": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "handling": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "taxTotal": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "discount": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        }
    -      },
    -      "currencyId": 0,
    -      "displayValue": "string",
    -      "value": "string"
    -    },
    -    "shipping": {
    -      "method": "string",
    -      "companyName": "string",
    -      "name": {
    -        "firstName": "string",
    -        "lastName": "string"
    -      },
    -      "emailAddress": "user@example.com",
    -      "phoneNumber": "string",
    -      "address": {
    -        "address1": "string",
    -        "address2": "string",
    -        "address3": "string",
    -        "provinceOrState": "string",
    -        "city": "string",
    -        "suburbOrDistrict": "string",
    -        "countryCode": "string",
    -        "postalCode": "string"
    -      }
    -    },
    -    "requireBuyerNameAndEmail": true,
    -    "buyerDataCollectionMessage": "string",
    -    "notesToRecipient": "string",
    -    "termsAndConditions": "string",
    -    "customData": {
    -      "additionalProp1": "string",
    -      "additionalProp2": "string",
    -      "additionalProp3": "string"
    -    },
    -    "metadata": {
    -      "integration": "string",
    -      "hostname": "string"
    -    }
    -  }
    -  
    -
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    clientIdThe id of the client creating this invoiceYes
    currencyIdThe id of the currency the invoice is to be in, alternatively this can be set individually per fieldNo
    invoiceIdThe optional API caller provided external invoice number. Appears in screens shown to the Buyer and emails sent.No
    buyerInfo about buyerNo
    descriptionThe purchase description, can be provided instead of a list of itemsNo
    itemsThe optional array of items that a buyer intends to purchase from the merchantNo
    amountThe total amount of the invoice, with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance and discounts, if anyYes
    shippingThe optional shipping method and addressNo
    requireBuyerNameAndEmailFlag indicating whether a buyer name and email are required, they will be requested at checkout if not provider by the callerNo
    buyerDataCollectionMessageThe message to display when collecting buyer user dataNo
    notesToRecipientAny additional information to share with the buyer about the transactionNo
    termsAndConditionsAny terms and conditions, e.g. a cancellation policyNo
    customDataAny custom data the caller wishes to attach to the invoice which will be sent back in notificationsNo
    metadataNo
    -

    Tutorial 2: User Currency Withdrawal

    -

    This tutorial will cover integrating the following features using the CoinPayments.net API.

    -
      -
    • Having a user withdraw an amount of currency from your CoinPayments.net account to a specified currency address (outside the CoinPayments.net system).
    • -
    • The withdrawing system checking it's currency balance before initiating the withdrawal.
    • -
    -

    Some example scenarios that this tutorial would apply to include:

    -
      -
    • A gambling platform where the user wishes to cash out some of their account's holdings.
    • -
    • A freelancer network where a job has been completed and the service provider needs to be paid by the network's system (acting as escrow).
    • -
    • A company paying it's employees payroll from their CoinPayments.net wallet.
    • -
    -

    To create a transaction and spend funds from an account we will send HTTP request (POST) to
    - /api​/v1​/accounts​/{id}​/spend. The request body should look like

    -
      -
    • id - The id of the account from which to spend funds from
    • -
    -
    {
    -    "recipients": [
    -      {
    -        "address": "string",
    -        "amount": "string"
    -      }
    -    ],
    -    "memo": "string",
    -    "customData": {
    -      "additionalProp1": {},
    -      "additionalProp2": {},
    -      "additionalProp3": {}
    -    }
    -  }
    -  
    -
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    recipientsThe list of recipients to send funds toYes
    memoCustom memo to attach to this transaction, this will only be visible within CoinPayments®No
    customDataOptional additional information for the spend request e.g. "UseHopAddress" for EthereumNo
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -    "spendRequestId": "string",
    -    "spendRequestToken": "string"
    -  }
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - -
    ParameterDescription
    spendRequestIdThe id of the created request to spend funds
    spendRequestTokenAdditional validation token that must be sent up with the signed request
    -

    Tutorial 3: Convert Coins

    -

    This tutorial covers converting coins in your CoinPayments.net wallet from one currency to another using the API request /api/v1/accounts/{id}/convert. It also explains how to first check the conversion limits for a coin pairing and confirm that conversion for the given pair is supported. Even though a call to the request will throw an error if the coin pairing is not supported, it's good practice to check the amount you're planning to convert is within the minimum and maximum limits, with the additional benefit of finding out before making the convert request call if the pairing is supported or not.

    -

    For create a transaction and convert funds from an account we'll send HTTP request(POST) to /api/v1/accounts/{id}/convert

    -
      -
    • id - The id of the account for converting
    • -
    -

    The request body should look like

    -
    {
    -    "convertToCurrency": 0,
    -    "recipients": [
    -      {
    -        "address": "string",
    -        "amount": "string"
    -      }
    -    ],
    -    "memo": "string",
    -    "customData": {
    -      "additionalProp1": {},
    -      "additionalProp2": {},
    -      "additionalProp3": {}
    -    }
    -  }
    -  
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    convertToCurrencyCurrency into which funds should be convertedYes
    recipientsYes
    memoCustom memo to attach to this transaction, this will only be visible within CoinPayments®No
    customDataOptional additional informationNo
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -    "spendRequestId": "string",
    -    "spendRequestToken": "string"
    -  }
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - -
    ParameterDescription
    spendRequestIdThe id of the created request to spend funds
    spendRequestTokenAdditional validation token that must be sent up with the signed request
    - - -

    Tutorial 4: Using the MerchantCallback api endpoints

    -

    This tutorial covers creating callback addresses CoinPayments.net using the API request /api/v1/merchant/callbacks and receiving IPNDTO on your url. It also explains how to list all callback addresses, find the callback address by its id, update information about the callback address and list information about all merchant transactions.

    - For sending any of these requests you have to use a pre-request for the authentication. Here is an example in JavaScript: -
    -    
    -  var clientId = "7aa5e7ba45d84d978c5ea7f62498abf4";
    -  var clientKey = "I1sCXrA4jS29f4JYk3mohCoErLHvpESW3XF83sxo/lg=";
    -  pm.request.headers.add({
    -      key: "X-CoinPayments-Client",
    -      value: clientId
    -  });
    -  var date = new Date().toUTCString();
    -  pm.request.headers.add({
    -      key: "X-CoinPayments-Timestamp",
    -      value: date
    -  });
    -  var text = pm.request.method + pm.request.url + clientId + date + pm.request.body;
    -  var hash = CryptoJS.HmacSHA256("\ufeff" + text, clientKey);
    -  var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
    -  pm.request.headers.add({
    -      key: "X-CoinPayments-Signature",
    -      value: hashInBase64
    -  });
    -    
    -  
    - -

    Receiving IPNDTO

    - -

    - When merchant, for example, makes a transaction, the request is sent to the url specified for callback address. -
    To receive IPNDTO you should make 3 steps: -

      -
    1. Create callback address by using the request describing below, specify your callback url webhook.
    2. -
    3. Deposit some crypto at the callback address.
    4. -
    5. Receive a ipndto at your callback url webhook.
    6. -
    -

    - -

    Part A: Creating callback addresses

    -

    For creating callback addresses we'll send HTTP request(POST) to /api/v1/merchant/callbacks

    -

    The request body should look like

    -
    {
    -    "clientId":"7aa5e7ba45d84d978c5ea7f62498abf4",
    -    "currencyId":4,
    -    "label":"testcallbacketh",
    -    "webhook":{
    -        "nativeCurrencyId":1,
    -        "url":"https://google.com"
    -    }
    -}
    -
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    clientIdThe id of the currency the address will be receivingNo
    currencyIdThe id of the currency the address will be receivingYes
    labelThe label of the address (display only)No
    webhookThe webhook notification information and customizationsNo
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -     "id":"6Fa43sdVgjHuZRMuzei8ae",
    -     "clientId":"AaXX9g2Zp99ij2cvLVymTN",
    -     "created":"2020-10-28T09:44:54.9986654+00:00",
    -     "currencyId":4,
    -     "address":"0x4ca1a7a8332d4cad0abe4dbcb58c10d6edf4e315",
    -     "label":"testcallbacketh",
    -     "webhook":{
    -         "url":"https://google.com",
    -         "nativeCurrencyId":1
    -     }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescription
    idThe unique id of the callback address
    clientIdThe merchant client this callback address is linked to
    createdThe timestamp of when the callback address was created
    currencyIdThe id of the currency the address is receiving
    addressThe actual deposit address
    labelThe display label of the callback address
    webhookThe webhook notification information and customizations
    - -

    Part B: Sending a request to spend funds from the account

    -

    This part was described in the Tutorial 2.

    - - After making these steps the request will be sent on your url. -

    The body of the request contains next information:

    -
    {
    -  "id": "bdaae1f4c051445099325f384a74e46b",
    -  "type": "CallbackDepositConfirmed",
    -  "timestamp": "2020-10-15T13:16:56.27704444+00:00",
    -  "transaction": {
    -    "callbackAddressId": "Lhdrs8hw6z3WWpHD6oMBea",
    -    "address": "0x4723e2edcdedd471e016b03765df8f9c56572c69",
    -    "currency": {
    -      "id": "4",
    -      "symbol": "ETH",
    -      "name": "Ethereum",
    -    },
    -    "amount": {
    -      "currencyId": "0",
    -      "displayValue": "0.000000000000000001",
    -      "value": "1"
    -    },
    -    "coinPaymentsFee": {
    -      "currencyId": "0",
    -      "displayValue": "0.000000000000000000",
    -      "value": "0"
    -    },
    -    "nativeCurrency": {
    -      "id": "1",
    -      "symbol": "BTC",
    -      "name": "Bitcoin",
    -    },
    -    "nativeAmount": {
    -      "currencyId": "0",
    -      "displayValue": "0.00000000",
    -      "value": "0"
    -    },
    -    "nativeCoinPaymentsFee": {
    -      "currencyId": "0",
    -      "displayValue": "0.00000000",
    -      "value": "0"
    -    },
    -    "status": "Confirmed"
    -  }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescription
    idThe unique id of the ipn notification
    typeThe type of notification
    timestampThe timestamp of when the notification was generated
    invoiceThe invoice the notification was sent for
    payoutsThe payout information of the invoice, once available
    transactionCallback deposit transaction
    customdataAny custom data associated with the callback address, specified at the time when the callback address was created
    - - -

    Other requests which can be helpful for working with callbacks:

    -
    -

    List of all callback addresses

    -

    For list all callback addresses sorted descending by the creation date we'll send HTTP request(GET) to /api/v1/merchant/callbacks

    -
      -
    • clientId - The merchant client id whose callback address should be listed
    • -
    • currencyId - The id of the currency the address was receiving
    • -
    • after -
    • -
    • limit -
    • -
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -     "items":[{
    -         "id":"6Fa43sdVgjHuZRMuzei8ae",
    -          "clientId":"AaXX9g2Zp99ij2cvLVymTN",
    -          "created":"2020-10-28T09:44:54.998665+00:00",
    -          "currencyId":4,
    -          "address":"0x4ca1a7a8332d4cad0abe4dbcb58c10d6edf4e315",
    -          "label":"testcallbacketh",
    -          "webhook":{
    -              "url":"https://google.com",
    -              "nativeCurrencyId":1
    -          }
    -     }],
    -     "paging":{
    -          "cursors":{
    -              "before":"WpESICZ72Ag=",
    -              "after":"At0ZPLdf2Ag="
    -          },
    -          "limit":100
    -     }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - -
    ParameterDescription
    itemsInformation about the callback address
    paging
    - -

    Searching the callback address by id

    -

    For listing all callback addresses with the same id we'll send HTTP request(GET) to /api/v1/merchant/callbacks/{id}

    -
      -
    • id - The id of the callback address
    • -
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -     "id":"56NVoGgbkPxStkhTjokV8E",
    -     "clientId":"AaXX9g2Zp99ij2cvLVymTN",
    -     "created":"2020-09-28T13:43:10.01129+00:00",
    -     "currencyId":4,
    -     "address":"0xbb050a0ab1e6a801ed6d2c7eac775737dea7d11e",
    -     "label":"testcallbacketh",
    -     "webhook":{
    -         "url":"https://google.com",
    -         "nativeCurrencyId":1
    -     }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescription
    idThe unique id of the callback address
    clientIdThe merchant client this callback address is linked to
    createdThe timestamp of when the callback address was created
    currencyIdThe id of the currency the address is receiving
    addressThe actual deposit address
    labelThe display label of the callback address
    webhookThe webhook notification information and customizations
    - -

    Updating a callback address

    -

    For updating a callback address we'll send HTTP request(PUT) to /api/v1/merchant/callbacks/{id}

    -
      -
    • id - The id of the callback address
    • -
    -

    The request body should look like

    -
    {
    -    "clientId":"7aa5e7ba45d84d978c5ea7f62498abf4",
    -    "currencyId":4,
    -    "label":"testcallbacketh",
    -    "webhook":{
    -        "nativeCurrencyId":1,
    -        "url":"https://google.com"
    -    }
    -}
    -  
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    labelThe label of the address (display only)No
    webhookThe webhook notification information and customizationsNo
    -

    When a request sent successfully then the server will return a response which will contain the status 204(No content)

    - - - - -

    Listing all deposit transactions to callback addresses

    -

    For listing all deposit transactions to callback addresses, ordered newest first and optionally filtering by address, currency and date range we'll send HTTP request(GET) to /api/v1/merchant/callbacks/{id}

    -
      -
    • callbackId - The id of the callback address
    • -
    • currencyId -
    • -
    • from -
    • -
    • to -
    • -
    • after -
    • -
    • limit -
    • - -
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -    "items":[{
    -        "id":"Dv1vDiDmfVrgSkEB2bLcUA",
    -        "created":"2020-09-25T08:36:23.470791+00:00",
    -        "completed":"2020-09-25T08:36:23.470793+00:00",
    -        "callbackAddressId":"JhmojzDdEJA8qJ4fF3zkT9",
    -        "address":"V7dHXKN6jKFXQrV3AKsYiePNezcgf7Cn2h",
    -        "currency":{
    -            "id":"33","symbol":"VLX",
    -            "name":"Velas","decimalPlaces":18},
    -            "nativeCurrency":{
    -                "id":"1",
    -                "symbol":"BTC",
    -                "name":"Bitcoin",
    -                "decimalPlaces":8
    -            },
    -            "amount":{
    -                "displayValue":"81.282438450358048310",
    -                "value":"81282438450358048310",
    -                "amount":"81282438450358048310",
    -                "currencyId":"0"
    -            },
    -            "coinPaymentsFee":{
    -                "displayValue":"0.406412192251790242",
    -                "value":"406412192251790242",
    -                "amount":"406412192251790242",
    -                "currencyId":"0"
    -            },
    -            "nativeAmount":{
    -                "displayValue":"0.00030505",
    -                "value":"30505",
    -                "amount":"30505",
    -                "currencyId":"1"
    -            },
    -            "nativeCoinPaymentsFee":{
    -                "displayValue":"0.00000153",
    -                "value":"153",
    -                "amount":"153",
    -                "currencyId":"1"
    -            },
    -            "status":"PaidOut"
    -        }],
    -        "paging":{
    -            "cursors":{
    -                "before":"xnPHFS5h2Ag=",
    -                "after":"TPRdkbdf2Ag="
    -            },
    -            "limit":100
    -        }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - - -
    ParameterDescription
    itemsInformation about callback address
    paging
    - -
    -
    -
    -
    - - -
    -`; - var contentHtml = `

    Use Cases Examples

    ${tutorialsHtml}
    `; - - var tablist = $("#tabs-list"); - tablist.insertBefore(createElementFromHTML(tabHtml), tablist.firstChild); - tablist.firstChild.firstChild.addEventListener('click', function () { window.location.hash = "#section/UseCasesExamples"; }); - window.location.hash = "#section/UseCasesExamples"; - - var apiContent = $("#apiContent") - apiContent.insertBefore(createElementFromHTML(contentHtml), apiContent.firstChild.nextSibling); - - }, 1000); \ No newline at end of file diff --git a/api-examples/callback/css/style.css b/api-examples/callback/css/style.css deleted file mode 100644 index 2c6fb04..0000000 --- a/api-examples/callback/css/style.css +++ /dev/null @@ -1,39 +0,0 @@ -#background{ - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(194, 194, 194, 0.226); - z-index: -100; -} -.for_forms{ - margin-top: 10vh; - padding: 1.5%; - background-color: #ffffff; - box-shadow: 5px 5px 10px 10px #cacaca; - border-radius: 10px 10px 10px 10px; -} -.for_forms label:nth-child(1){ - margin-top: 0.5vh; -} -.for_output { - width: 100vw; - margin-top: 5vh; - margin-bottom: 5vh; - padding: 1.5%; - background-color: #ffffff; - box-shadow: 5px 5px 10px 10px #cacaca; - border-radius: 10px 10px 10px 10px; - visibility: hidden; -} - -#currencyId_for_create_callbacks, #native-currencyId_for_create_callbacks{ - height: 3vh; - font-size: 11pt; -} - -.alert{ - display: none; - margin-top: 1vh; -} \ No newline at end of file diff --git a/api-examples/callback/index.html b/api-examples/callback/index.html deleted file mode 100644 index debd43a..0000000 --- a/api-examples/callback/index.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - CoinPayments - Callbacks Test (INTERNAL) - - - - - - - - - - - - - -
    - -
    CoinPayments - Callbacks Test (INTERNAL)
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - -
    -
    - - -
    -
    - - -
    -

    -

    -

    -

    - -
    -
    -
    - -
    -
    - - -
    -
    - - -
    - -
    -
    -
    - -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    - -
    - -
    - - - - - - - - - - - - - - - diff --git a/api-examples/callback/js/data_output.js b/api-examples/callback/js/data_output.js deleted file mode 100644 index af73beb..0000000 --- a/api-examples/callback/js/data_output.js +++ /dev/null @@ -1,253 +0,0 @@ -function outputAboutCreatedCallback(result){ - var callback = JSON.parse(result); - alert("Callback was created successfully!"); - var callbackHTML = '
    '; - - callbackHTML += '
    '; - callbackHTML += ''; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += '
    '; - - callbackHTML += '
    '; - - callbackHTML += '
    '; - callbackHTML += ''; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += '
    '; - - callbackHTML += '
    '; - callbackHTML += '

    Currency

    '; - callbackHTML += `

    ${globalCurrenciesById[callback.currencyId].name}

    `; - - callbackHTML += '
    '; - var for_output = document.getElementById("for_output"); - for_output.style.visibility = "visible"; - for_output.innerHTML = callbackHTML; - return result; -} - -function output_search_pannel(id){ - var search = '
    '; - search +=``; - search +='
    ' - search +=''; - search +='
    '; - search +='
    '; - return search; -} - -function output_callbacks(result){ - var callbacks_list = JSON.parse(result).items; - var counter = 0; - - var callbacksHTML = output_search_pannel("callback_id_for_searching"); - - callbacksHTML += '
    '; - callbacks_list.filter(element => { - callbacksHTML += ``; - callbacksHTML += '
    '; - callbacksHTML += '
    '; - var splits = parseIsoDatetime(element.created).toString().split(' '); - callbacksHTML += splits[1]; - callbacksHTML += ' '; - callbacksHTML += splits[2]; - callbacksHTML += '
    '; - callbacksHTML += splits[4]; - callbacksHTML += '
    '; - - callbacksHTML += '
    '; - callbacksHTML += globalCurrenciesById[element.currencyId].name; - callbacksHTML += '
    '; - - callbacksHTML += '
    '; - if (element.address.length > 70){ - for (var i = 0; i<=50; i++){ - callbacksHTML += element.address[i]; - } - callbacksHTML += '...'; - for (var i = 1; i<=20; i++){ - callbacksHTML += element.address[element.address.length-i]; - } - } - else{ - callbacksHTML += element.address; - } - callbacksHTML += '
    '; - callbacksHTML += '
    '; - - - callbacksHTML += '
    '; - callbacksHTML += `
    `; - callbacksHTML += '
    '; - callbacksHTML += ''; - callbacksHTML += '
    '; - callbacksHTML += ``; - callbacksHTML += '
    '; - callbacksHTML += ``; - callbacksHTML += '
    '; - callbacksHTML += "
    "; - - callbacksHTML += '
    '; - callbacksHTML += ''; - callbacksHTML += '
    '; - callbacksHTML += ``; - callbacksHTML += '
    '; - callbacksHTML += ``; - callbacksHTML += '
    '; - callbacksHTML += "
    "; - - callbacksHTML += `
    `; - counter++; - }); - callbacksHTML += '
    '; - var for_output = document.getElementById("for_output"); - for_output.style.visibility = "visible"; - for_output.innerHTML = callbacksHTML; - return result; -} - -function output_transactions(result){ - var transactions_list = JSON.parse(result).items; - var counter = 0; - - var transactionsHTML = '
    '; - transactions_list.filter(element => { - transactionsHTML += ``; - transactionsHTML += '
    '; - transactionsHTML += '
    '; - var splits = parseIsoDatetime(element.created).toString().split(' '); - transactionsHTML += splits[1]; - transactionsHTML += ' '; - transactionsHTML += splits[2]; - transactionsHTML += '
    '; - transactionsHTML += splits[4]; - transactionsHTML += '
    '; - - transactionsHTML += '
    '; - transactionsHTML += element.currency.name; - transactionsHTML += '
    '; - - transactionsHTML += '
    '; - transactionsHTML += element.amount.displayValue; - transactionsHTML += '
    '; - - transactionsHTML += '
    '; - transactionsHTML += element.status; - transactionsHTML += '
    '; - - transactionsHTML += '
    '; - - transactionsHTML += '
    '; - transactionsHTML += `
    `; - transactionsHTML += '
    '; - transactionsHTML += ''; - transactionsHTML += `

    ${element.amount.displayValue} ${element.currency.symbol}

    `; - transactionsHTML += ``; - transactionsHTML += '
    '; - transactionsHTML += ``; - transactionsHTML += '
    '; - transactionsHTML += ``; - transactionsHTML += '
    '; - transactionsHTML += "
    "; - transactionsHTML += '
    '; - counter++; - }); - - transactionsHTML += '
    '; - var for_output = document.getElementById("for_output"); - for_output.style.visibility = "visible"; - for_output.innerHTML = transactionsHTML; - return result; -} - -function copyFunction(id_for_copy) { - var copyText = document.getElementById(`${id_for_copy}`); - copyText.select(); - copyText.setSelectionRange(0, 99999) - document.execCommand("copy"); -} - -function output_callback_for_edit(result){ - - var callback = JSON.parse(result); - var callbackHTML = output_search_pannel("callback_id_for_searching"); - - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += '
    '; - var splits = parseIsoDatetime(callback.created).toString().split(' '); - callbackHTML += splits[1]; - callbackHTML += ' '; - callbackHTML += splits[2]; - callbackHTML += '
    '; - callbackHTML += splits[4]; - callbackHTML += '
    '; - - callbackHTML += '
    '; - callbackHTML += globalCurrenciesById[callback.currencyId].name; - callbackHTML += '
    '; - - callbackHTML += '
    '; - if (callback.address.length > 70){ - for (var i = 0; i<=50; i++){ - callbackHTML += callback.address[i]; - } - callbackHTML += '...'; - for (var i = 1; i<=20; i++){ - callbackHTML += callback.address[callback.address.length-i]; - } - } - else{ - callbackHTML += callback.address; - } - callbackHTML += '
    '; - callbackHTML += '
    '; - - - callbackHTML += '
    '; - callbackHTML += `
    `; - callbackHTML += '
    '; - callbackHTML += ''; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += "
    "; - - callbackHTML += '
    '; - callbackHTML += ''; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += "
    "; - - callbackHTML += '
    '; - callbackHTML += ''; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += ``; - callbackHTML += '
    '; - callbackHTML += "
    "; - - callbackHTML += `
    `; - - var for_output = document.getElementById("for_output"); - for_output.style.visibility = "visible"; - for_output.innerHTML = callbackHTML; - return result; -} \ No newline at end of file diff --git a/api-examples/callback/js/editing_callback.js b/api-examples/callback/js/editing_callback.js deleted file mode 100644 index b089fbb..0000000 --- a/api-examples/callback/js/editing_callback.js +++ /dev/null @@ -1,43 +0,0 @@ -function editFunction(callback_id){ - var newLabel = document.getElementById("callbacksLabel").value; - if (newLabel == ''){ - return false; - } - - var customerId = document.getElementById("customerId_for_view_callbacks").value; - var secretId = document.getElementById("secretId_for_view_callbacks").value; - - if (secretId=='' || customerId=='') { - output_error("viewCallbacks_alert", "Please enter an customer id and secret id"); - return false; - } - -var Data = -`{\r -"label": "${newLabel}"\r -}\r -}`; - var date = new Date().toUTCString(); - var text = "PUT"+ alphaApi + "/api/v1/merchant/callbacks"+ `/${callback_id}` + customerId + date + Data; - var hash = CryptoJS.HmacSHA256("\ufeff" + text, secretId); - var hashInBase64 = CryptoJS.enc.Base64.stringify(hash); - - var Myheaders = new Headers(); - Myheaders.append("X-CoinPayments-Client", customerId); - Myheaders.append("X-CoinPayments-Timestamp", date); - Myheaders.append("X-CoinPayments-Signature", hashInBase64); - Myheaders.append("Content-Type", "application/json"); - - var requestOptions = { - method: 'PUT', - headers: Myheaders, - body: Data, - redirect: 'follow' - }; - - return fetch(alphaApi + "/api/v1/merchant/callbacks"+`/${callback_id}`, requestOptions) - .then(response => response.text()) - .then(result => alert("Label has been changed")) - .catch(error => { console.log('error', error);}); - -} diff --git a/api-examples/callback/js/enc-base64.js b/api-examples/callback/js/enc-base64.js deleted file mode 100644 index 739f4a8..0000000 --- a/api-examples/callback/js/enc-base64.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -CryptoJS v3.1.2 -code.google.com/p/crypto-js -(c) 2009-2013 by Jeff Mott. All rights reserved. -code.google.com/p/crypto-js/wiki/License -*/ -(function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * Base64 encoding strategy. - */ - var Base64 = C_enc.Base64 = { - /** - * Converts a word array to a Base64 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Base64 string. - * - * @static - * - * @example - * - * var base64String = CryptoJS.enc.Base64.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - var map = this._map; - - // Clamp excess bits - wordArray.clamp(); - - // Convert - var base64Chars = []; - for (var i = 0; i < sigBytes; i += 3) { - var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; - var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; - - var triplet = (byte1 << 16) | (byte2 << 8) | byte3; - - for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { - base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); - } - } - - // Add padding - var paddingChar = map.charAt(64); - if (paddingChar) { - while (base64Chars.length % 4) { - base64Chars.push(paddingChar); - } - } - - return base64Chars.join(''); - }, - - /** - * Converts a Base64 string to a word array. - * - * @param {string} base64Str The Base64 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Base64.parse(base64String); - */ - parse: function (base64Str) { - // Shortcuts - var base64StrLength = base64Str.length; - var map = this._map; - - // Ignore padding - var paddingChar = map.charAt(64); - if (paddingChar) { - var paddingIndex = base64Str.indexOf(paddingChar); - if (paddingIndex != -1) { - base64StrLength = paddingIndex; - } - } - - // Convert - var words = []; - var nBytes = 0; - for (var i = 0; i < base64StrLength; i++) { - if (i % 4) { - var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2); - var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2); - words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); - nBytes++; - } - } - - return WordArray.create(words, nBytes); - }, - - _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' - }; -}()); diff --git a/api-examples/callback/js/errors.js b/api-examples/callback/js/errors.js deleted file mode 100644 index 3ba1624..0000000 --- a/api-examples/callback/js/errors.js +++ /dev/null @@ -1,12 +0,0 @@ -function output_error(type_of_alert, text){ - var alert = document.getElementById(type_of_alert); - alert.style.display = "block"; - var alertHTML = `

    !${text}

    `; - alert.innerHTML = alertHTML; -} - -function output_searching_error(){ - var error = document.getElementById("for_output"); - var errorHTML = output_search_pannel("callback_id_for_searching") + `

    No results

    `; - error.innerHTML = errorHTML; -} \ No newline at end of file diff --git a/api-examples/callback/js/hmac-sha256.js b/api-examples/callback/js/hmac-sha256.js deleted file mode 100644 index c822cfb..0000000 --- a/api-examples/callback/js/hmac-sha256.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -CryptoJS v3.1.2 -code.google.com/p/crypto-js -(c) 2009-2013 by Jeff Mott. All rights reserved. -code.google.com/p/crypto-js/wiki/License -*/ -var CryptoJS=CryptoJS||function(h,s){var f={},g=f.lib={},q=function(){},m=g.Base={extend:function(a){q.prototype=this;var c=new q;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}, -r=g.WordArray=m.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=s?c:4*a.length},toString:function(a){return(a||k).stringify(this)},concat:function(a){var c=this.words,d=a.words,b=this.sigBytes;a=a.sigBytes;this.clamp();if(b%4)for(var e=0;e>>2]|=(d[e>>>2]>>>24-8*(e%4)&255)<<24-8*((b+e)%4);else if(65535>>2]=d[e>>>2];else c.push.apply(c,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<< -32-8*(c%4);a.length=h.ceil(c/4)},clone:function(){var a=m.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],d=0;d>>2]>>>24-8*(b%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var c=a.length,d=[],b=0;b>>3]|=parseInt(a.substr(b, -2),16)<<24-4*(b%8);return new r.init(d,c/2)}},n=l.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var d=[],b=0;b>>2]>>>24-8*(b%4)&255));return d.join("")},parse:function(a){for(var c=a.length,d=[],b=0;b>>2]|=(a.charCodeAt(b)&255)<<24-8*(b%4);return new r.init(d,c)}},j=l.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}}, -u=g.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,d=c.words,b=c.sigBytes,e=this.blockSize,f=b/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;b=h.min(4*a,b);if(a){for(var g=0;gn;){var j;a:{j=k;for(var u=h.sqrt(j),t=2;t<=u;t++)if(!(j%t)){j=!1;break a}j=!0}j&&(8>n&&(m[n]=l(h.pow(k,0.5))),r[n]=l(h.pow(k,1/3)),n++);k++}var a=[],f=f.SHA256=q.extend({_doReset:function(){this._hash=new g.init(m.slice(0))},_doProcessBlock:function(c,d){for(var b=this._hash.words,e=b[0],f=b[1],g=b[2],j=b[3],h=b[4],m=b[5],n=b[6],q=b[7],p=0;64>p;p++){if(16>p)a[p]= -c[d+p]|0;else{var k=a[p-15],l=a[p-2];a[p]=((k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3)+a[p-7]+((l<<15|l>>>17)^(l<<13|l>>>19)^l>>>10)+a[p-16]}k=q+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&m^~h&n)+r[p]+a[p];l=((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+(e&f^e&g^f&g);q=n;n=m;m=h;h=j+k|0;j=g;g=f;f=e;e=k+l|0}b[0]=b[0]+e|0;b[1]=b[1]+f|0;b[2]=b[2]+g|0;b[3]=b[3]+j|0;b[4]=b[4]+h|0;b[5]=b[5]+m|0;b[6]=b[6]+n|0;b[7]=b[7]+q|0},_doFinalize:function(){var a=this._data,d=a.words,b=8*this._nDataBytes,e=8*a.sigBytes; -d[e>>>5]|=128<<24-e%32;d[(e+64>>>9<<4)+14]=h.floor(b/4294967296);d[(e+64>>>9<<4)+15]=b;a.sigBytes=4*d.length;this._process();return this._hash},clone:function(){var a=q.clone.call(this);a._hash=this._hash.clone();return a}});s.SHA256=q._createHelper(f);s.HmacSHA256=q._createHmacHelper(f)})(Math); -(function(){var h=CryptoJS,s=h.enc.Utf8;h.algo.HMAC=h.lib.Base.extend({init:function(f,g){f=this._hasher=new f.init;"string"==typeof g&&(g=s.parse(g));var h=f.blockSize,m=4*h;g.sigBytes>m&&(g=f.finalize(g));g.clamp();for(var r=this._oKey=g.clone(),l=this._iKey=g.clone(),k=r.words,n=l.words,j=0;j response.text()) - .then(result => output_callback_for_edit(result)) - .catch(error => {console.log('error', error); output_searching_error()}); -} diff --git a/api-examples/callback/js/working_with_currency.js b/api-examples/callback/js/working_with_currency.js deleted file mode 100644 index f9b0dd7..0000000 --- a/api-examples/callback/js/working_with_currency.js +++ /dev/null @@ -1,44 +0,0 @@ -var alphaApi="https://api.coinpayments.net"; - -var globalCurrenciesList = []; -var globalCurrenciesById = {}; - -(function () { - window.fetch(alphaApi + "/api/v1/currencies", { method: "GET" }).then(response => { - response.json().then(currenciesPage => { - console.log(currenciesPage); - - var currencies = globalCurrenciesList = currenciesPage.items; - - var currenciesHtml = ''; - currenciesHtml += ""; - document.getElementById("currency-selector").innerHTML = currenciesHtml; - document.getElementById("currencyId_for_create_callbacks").setAttribute("disabled", true); - - var native_currenciesHtml = ''; - native_currenciesHtml += ""; - document.getElementById("native-currency-selector").innerHTML = native_currenciesHtml; - document.getElementById("native-currencyId_for_create_callbacks").setAttribute("disabled", true); - }); - }); -})(); - -function currency_id_togler(){ - var customerId = document.getElementById("customerId_for_create_callbacks").value; - var secretId = document.getElementById("secretId_for_create_callbacks").value; - var label = document.getElementById("label_for_create_callbacks").value; - if (customerId && secretId && label){ - document.getElementById("currencyId_for_create_callbacks").disabled = false; - document.getElementById("native-currencyId_for_create_callbacks").disabled = false; - } - else{ - document.getElementById("currencyId_for_create_callbacks").disabled = true; - document.getElementById("native-currencyId_for_create_callbacks").disabled = true; - } -} diff --git a/api-examples/callback/js/working_with_forms.js b/api-examples/callback/js/working_with_forms.js deleted file mode 100644 index 3c8e22c..0000000 --- a/api-examples/callback/js/working_with_forms.js +++ /dev/null @@ -1,122 +0,0 @@ -function createCallbackAddress() { - var customerId = document.getElementById("customerId_for_create_callbacks").value; - var secretId = document.getElementById("secretId_for_create_callbacks").value; - var currencyId = document.getElementById("currencyId_for_create_callbacks").value; - var nativeCurrencyId = document.getElementById("native-currencyId_for_create_callbacks").value; - var label = document.getElementById("label_for_create_callbacks").value; - document.getElementById("createCallback_alert").style.display="none"; - document.getElementById("for_output").style.visibility="hidden"; - - if (secretId=='' || customerId=='' || label == '') { - output_error("createCallback_alert", "Please enter a customer id, secret id, label, currency and native currency"); - return false; - } - -var Data = -`{\r -"clientId": "${customerId}",\r -"currencyId": ${currencyId},\r -"label": "${label}",\r -"webhook": {\r -"nativeCurrencyId": ${nativeCurrencyId},\r -"url": "https://google.com"\r -}\r -}`; - var date = new Date().toUTCString(); - var text = "POST"+ alphaApi + "/api/v1/merchant/callbacks" + customerId + date + Data; - var hash = CryptoJS.HmacSHA256("\ufeff" + text, secretId); - var hashInBase64 = CryptoJS.enc.Base64.stringify(hash); - - var Myheaders = new Headers(); - Myheaders.append("X-CoinPayments-Client", customerId); - Myheaders.append("X-CoinPayments-Timestamp", date); - Myheaders.append("X-CoinPayments-Signature", hashInBase64); - Myheaders.append("Content-Type", "application/json"); - - var requestOptions = { - method: 'POST', - headers: Myheaders, - body: Data, - redirect: 'follow' - }; - - return fetch(alphaApi + "/api/v1/merchant/callbacks", requestOptions) - .then(response => response.text()) - .then(result => outputAboutCreatedCallback(result)) - .catch(error => { console.log('error', error); output_error("createCallback_alert", "Data are incorrect. Please, change them and try again!");}); -} -function viewCallbacks(){ - var customerId = document.getElementById("customerId_for_view_callbacks").value; - var secretId = document.getElementById("secretId_for_view_callbacks").value; - - document.getElementById("viewCallbacks_alert").style.display="none"; - document.getElementById("for_output").style.visibility="hidden"; - - if (secretId=='' || customerId=='') { - output_error("viewCallbacks_alert", "Please enter customer id and secret id"); - return false; - } - - var date = new Date().toUTCString(); - var text = "GET"+ alphaApi + "/api/v1/merchant/callbacks" + customerId + date; - console.log(text); - var hash = CryptoJS.HmacSHA256("\ufeff" + text, secretId); - var hashInBase64 = CryptoJS.enc.Base64.stringify(hash); - - var Myheaders = new Headers(); - Myheaders.append("X-CoinPayments-Client", customerId); - Myheaders.append("X-CoinPayments-Timestamp", date); - Myheaders.append("X-CoinPayments-Signature", hashInBase64); - Myheaders.append("Content-Type", "application/json"); - - var requestOptions = { - method: 'GET', - headers: Myheaders, - redirect: 'follow' - }; - - return fetch(alphaApi + "/api/v1/merchant/callbacks", requestOptions) - .then(response => response.text()) - .then(result => output_callbacks(result)) - .catch(error => { console.log('error', error); output_error("viewCallbacks_alert", "Data are incorrect. Please, change them and try again!");}); -} - -function viewTransactions(){ - var customerId = document.getElementById("customerId_for_view_transactions").value; - var secretId = document.getElementById("secretId_for_view_transactions").value; - - document.getElementById("viewTransactions_alert").style.display="none"; - document.getElementById("for_output").style.visibility="hidden"; - - if (secretId=='' || customerId=='') { - output_error("viewTransactions_alert", "Please enter an customer and secret id"); - return false; - } - - var date = new Date().toUTCString(); - var text = "GET"+ alphaApi + "/api/v1/merchant/callbacks/deposits" + customerId + date; - var hash = CryptoJS.HmacSHA256("\ufeff" + text, secretId); - var hashInBase64 = CryptoJS.enc.Base64.stringify(hash); - - var Myheaders = new Headers(); - Myheaders.append("X-CoinPayments-Client", customerId); - Myheaders.append("X-CoinPayments-Timestamp", date); - Myheaders.append("X-CoinPayments-Signature", hashInBase64); - Myheaders.append("Content-Type", "application/json"); - - var requestOptions = { - method: 'GET', - headers: Myheaders, - redirect: 'follow' - }; - - return fetch(alphaApi + "/api/v1/merchant/callbacks/deposits", requestOptions) - .then(response => response.text()) - .then(result => output_transactions(result)) - .catch(error => { console.log('error', error); output_error("viewTransactions_alert", "Data are incorrect. Please, change them and try again!");}); -} - -function parseIsoDatetime(dtstr) { - var dt = dtstr.split(/[: T-]/).map(parseFloat); - return new Date(dt[0], dt[1] - 1, dt[2], dt[3] || 0, dt[4] || 0, dt[5] || 0, 0); -} diff --git a/api-examples/currencies/index.php b/api-examples/currencies/index.php deleted file mode 100644 index 785949d..0000000 --- a/api-examples/currencies/index.php +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - - -
    -
    - Code sample -
    -
    -
    -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    -
    - - -
    - -
    - "; - echo sprintf("%s", $response); - echo ""; - - } - - ?> - -format('c'), - 'X-CoinPayments-Signature: ' . $signature, - ]; - - $options = [ - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HEADER => true, - CURLOPT_SSL_VERIFYHOST => 0, - CURLOPT_SSL_VERIFYPEER => 0, - CURLOPT_URL => $apiUrl, - CURLOPT_HTTPHEADER => $headers, - ]; - - if ($method == 'POST') { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } - - curl_setopt_array($curl, $options); - - $response = curl_exec($curl); - curl_close($curl); - - return $response; -} - -function signature($method, $apiUrl, $clientId, $date, $clientSecret, $params) -{ - - $signatureString = implode('', [ - chr(239), - chr(187), - chr(191), - $method, - $apiUrl, - $clientId, - $date->format('c'), - $params - ]); - - return base64_encode(hash_hmac('sha256', $signatureString, $clientSecret, true)); -} \ No newline at end of file diff --git a/api-examples/external-conversion/index.php b/api-examples/external-conversion/index.php deleted file mode 100644 index 9e7b5a0..0000000 --- a/api-examples/external-conversion/index.php +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - -
    -
    - Code sample -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    - - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - - - -
    -
    - $_GET['fromId'], - "toCurrencyId" => $_GET['toId'], - "fromContractAddress" => $_GET['fromContact'], - "toContractAddress" => $_GET['toContact'], - "address" => $_GET['address'], - "amount" => $_GET['amount'], - ]; - break; - - case 'create': - $method = 'POST'; - $apiUrl = 'https://orion-api.starhermit.com/api/v1/externalconversions/create'; - $params = [ - "fromCurrencyId" => $_GET['fromId'], - "toCurrencyId" => $_GET['toId'], - "fromContractAddress" => $_GET['fromContact'], - "toContractAddress" => $_GET['toContact'], - "address" => $_GET['address'], - "refundAddress" => $_GET['refundAddress'], - ]; - break; - - } - - $response = sendRequest($method, $apiUrl, $_GET['clientId'], $_GET['clientSecret'], $date, $params); - - echo "
    ";
    -        echo sprintf("%s", $response);
    -        echo "
    "; - - } - - ?> - -format('c'), - 'X-CoinPayments-Signature: ' . $signature, - ]; - - $options = [ - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HEADER => true, - CURLOPT_SSL_VERIFYHOST => 0, - CURLOPT_SSL_VERIFYPEER => 0, - CURLOPT_URL => $apiUrl, - CURLOPT_HTTPHEADER => $headers, - ]; - - if ($method == 'POST') { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } - - curl_setopt_array($curl, $options); - - $response = curl_exec($curl); - curl_close($curl); - - return $response; -} - -function signature($method, $apiUrl, $clientId, $date, $clientSecret, $params) -{ - - $signatureString = implode('', [ - chr(239), - chr(187), - chr(191), - $method, - $apiUrl, - $clientId, - $date->format('c'), - $params - ]); - - return base64_encode(hash_hmac('sha256', $signatureString, $clientSecret, true)); -} - diff --git a/api-examples/invoices/index.php b/api-examples/invoices/index.php deleted file mode 100644 index 5c1ed9d..0000000 --- a/api-examples/invoices/index.php +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - -
    -
    - Code sample -
    -
    -
    -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    -
    - - -
    - -
    - $_GET['clientId'], - "currencyId" => $_GET['currency_id'], - "buyer" => [ - "companyName" => $_GET['company'], - "name" => [ - "firstName" => $_GET['first_name'], - "lastName" => $_GET['last_name'] - ], - "emailAddress" => $_GET['email'], - "phoneNumber" => $_GET['phone'], - "address" => [ - "address1" => $_GET['address_1'], - "address2" => $_GET['address_2'], - "address3" => $_GET['address_3'], - "provinceOrState" => $_GET['province_state'], - "city" => $_GET['city'], - "suburbOrDistrict" => $_GET['suburb_district'], - "countryCode" => $_GET['country_code'], - "postalCode" => $_GET['postal_code'] - ] - ], - "description" => $_GET['description'], - "amount" => [ - "currencyId" => $_GET['currency_id'], - "displayValue" => $_GET['amount'], - "value" => $_GET['amount'] - ], - "notesToRecipient" => $_GET['notes_to_recipient'] - ]; - break; - - case 'update': - $method = 'PUT'; - $apiUrl = 'https://api.coinpayments.net/api/v1/invoices/' . $_GET['invoice_id']; - $params = [ - "buyer" => [ - "companyName" => $_GET['company'], - "name" => [ - "firstName" => $_GET['first_name'], - "lastName" => $_GET['last_name'] - ], - "emailAddress" => $_GET['email'], - "phoneNumber" => $_GET['phone'], - "address" => [ - "address1" => $_GET['address_1'], - "address2" => $_GET['address_2'], - "address3" => $_GET['address_3'], - "provinceOrState" => $_GET['province_state'], - "city" => $_GET['city'], - "suburbOrDistrict" => $_GET['suburb_district'], - "countryCode" => $_GET['country_code'], - "postalCode" => $_GET['postal_code'] - ] - ] - ]; - break; - - case 'find': - $method = 'PUT'; - $apiUrl = 'https://api.coinpayments.net/api/v1/invoices/' . $_GET['invoice_id']; - break; - } - - $response = sendRequest($method, $apiUrl, $_GET['clientId'], $_GET['clientSecret'], $date, $params); - - echo "
    ";
    -        echo sprintf("%s", $response);
    -        echo "
    "; - - } - - ?> - -format('c'), - 'X-CoinPayments-Signature: ' . $signature, - ]; - - $options = [ - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HEADER => true, - CURLOPT_SSL_VERIFYHOST => 0, - CURLOPT_SSL_VERIFYPEER => 0, - CURLOPT_URL => $apiUrl, - CURLOPT_HTTPHEADER => $headers, - ]; - - if ($method == 'POST') { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } - - curl_setopt_array($curl, $options); - - $response = curl_exec($curl); - curl_close($curl); - - return $response; -} - -function signature($method, $apiUrl, $clientId, $date, $clientSecret, $params) -{ - - $signatureString = implode('', [ - chr(239), - chr(187), - chr(191), - $method, - $apiUrl, - $clientId, - $date->format('c'), - $params - ]); - - return base64_encode(hash_hmac('sha256', $signatureString, $clientSecret, true)); -} \ No newline at end of file diff --git a/api-examples/rates/index.php b/api-examples/rates/index.php deleted file mode 100644 index 9e2a3bd..0000000 --- a/api-examples/rates/index.php +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - -
    -
    - Code sample -
    -
    -
    -
    - - -
    - - -
    - - -
    - -
    - - -
    - -
    -
    - "; - echo sprintf("%s", $response); - echo ""; - - } - - ?> - -format('c'), - 'X-CoinPayments-Signature: ' . $signature, - ]; - - $options = [ - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HEADER => true, - CURLOPT_SSL_VERIFYHOST => 0, - CURLOPT_SSL_VERIFYPEER => 0, - CURLOPT_URL => $apiUrl, - CURLOPT_HTTPHEADER => $headers, - ]; - - if ($method == 'POST') { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } - - - curl_setopt_array($curl, $options); - - $response = curl_exec($curl); - curl_close($curl); - - return $response; -} - -function signature($method, $apiUrl, $clientId, $date, $clientSecret, $params) -{ - - $signatureString = implode('', [ - chr(239), - chr(187), - chr(191), - $method, - $apiUrl, - $clientId, - $date->format('c'), - $params - ]); - - return base64_encode(hash_hmac('sha256', $signatureString, $clientSecret, true)); -} - diff --git a/api-examples/ratesV2/index.php b/api-examples/ratesV2/index.php deleted file mode 100644 index fe69813..0000000 --- a/api-examples/ratesV2/index.php +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - -
    -
    - Code sample -
    -
    -
    -
    - - -
    - - -
    - - -
    - -
    - - -
    - -
    -
    - "; - echo sprintf("%s", $response); - echo ""; - - } - - ?> - -format('c'), - 'X-CoinPayments-Signature: ' . $signature, - ]; - - $options = [ - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HEADER => true, - CURLOPT_SSL_VERIFYHOST => 0, - CURLOPT_SSL_VERIFYPEER => 0, - CURLOPT_URL => $apiUrl, - CURLOPT_HTTPHEADER => $headers, - ]; - - if ($method == 'POST') { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } - - - curl_setopt_array($curl, $options); - - $response = curl_exec($curl); - curl_close($curl); - - return $response; -} - -function signature($method, $apiUrl, $clientId, $date, $clientSecret, $params) -{ - - $signatureString = implode('', [ - chr(239), - chr(187), - chr(191), - $method, - $apiUrl, - $clientId, - $date->format('c'), - $params - ]); - - return base64_encode(hash_hmac('sha256', $signatureString, $clientSecret, true)); -} - diff --git a/api-examples/settings/index.php b/api-examples/settings/index.php deleted file mode 100644 index c416b84..0000000 --- a/api-examples/settings/index.php +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - -
    -
    - Code sample -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    - - -
    - - -
    - -
    - - -
    - -
    -
    - $_GET['key'], - "value" => $_GET['value'] - ]; - break; - } - - $response = sendRequest($method, $apiUrl, $_GET['clientId'], $_GET['clientSecret'], $date, $params); - - echo "
    ";
    -        echo sprintf("%s", $response);
    -        echo "
    "; - - } - - ?> - -format('c'), - 'X-CoinPayments-Signature: ' . $signature, - ]; - - $options = [ - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HEADER => true, - CURLOPT_SSL_VERIFYHOST => 0, - CURLOPT_SSL_VERIFYPEER => 0, - CURLOPT_URL => $apiUrl, - CURLOPT_HTTPHEADER => $headers, - ]; - - if ($method == 'POST') { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } - - - curl_setopt_array($curl, $options); - - $response = curl_exec($curl); - curl_close($curl); - - return $response; -} - -function signature($method, $apiUrl, $clientId, $date, $clientSecret, $params) -{ - - $signatureString = implode('', [ - chr(239), - chr(187), - chr(191), - $method, - $apiUrl, - $clientId, - $date->format('c'), - $params - ]); - - return base64_encode(hash_hmac('sha256', $signatureString, $clientSecret, true)); -} - diff --git a/api-examples/wallet/index.php b/api-examples/wallet/index.php deleted file mode 100644 index ec6cf5f..0000000 --- a/api-examples/wallet/index.php +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - -
    -
    - Code sample -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - -
    -
    - - - -
    -
    - $_GET['currencyId'], - "label" => $_GET['label'], - "webhookUrl" => $_GET['webhookUrl'], - ]; - break; - case 'Find by id': - $method = 'GET'; - $apiUrl = 'https://api.coinpayments.net/api/v1/merchant/wallets' . '/' . $_GET['idForFinding']; - break; - case 'List all': - $method = 'GET'; - $apiUrl = 'https://api.coinpayments.net/api/v1/merchant/wallets'; - break; - case 'List transactions': - $method = 'GET'; - $apiUrl = 'https://api.coinpayments.net/api/v1/merchant/wallets' . '/' . $_GET['idForFinding'] . '/transactions'; - break; - - - } - - $response = sendRequest($method, $apiUrl, $_GET['clientId'], $_GET['clientSecret'], $date, $params); - - echo "
    ";
    -        echo sprintf("%s", $response);
    -        echo "
    "; - - } - - ?> - -format('c'), - 'X-CoinPayments-Signature: ' . $signature, - ]; - - $options = [ - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HEADER => true, - CURLOPT_SSL_VERIFYHOST => 0, - CURLOPT_SSL_VERIFYPEER => 0, - CURLOPT_URL => $apiUrl, - CURLOPT_HTTPHEADER => $headers, - ]; - - if ($method == 'POST') { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } - - - curl_setopt_array($curl, $options); - - $response = curl_exec($curl); - curl_close($curl); - - return $response; -} - -function signature($method, $apiUrl, $clientId, $date, $clientSecret, $params) -{ - - $signatureString = implode('', [ - chr(239), - chr(187), - chr(191), - $method, - $apiUrl, - $clientId, - $date->format('c'), - $params - ]); - - return base64_encode(hash_hmac('sha256', $signatureString, $clientSecret, true)); -} - diff --git a/custom-button-styles.css b/custom-button-styles.css deleted file mode 100644 index e7b1535..0000000 --- a/custom-button-styles.css +++ /dev/null @@ -1,72 +0,0 @@ - body { - padding: 0; - margin: 0; - } - - .log-heading { - margin: 0; - padding: 0; - } - - .log-level { - font-weight: bold; - display: inline-block; - width: 45px; - margin-right: 10px; - margin-left: -5px; - padding-left: 5px; - } - - .log-category { - color: rgb(240,240,240); - } - - .log-exception { - color: #ff6673; - padding-left: 50px; - margin: 0; - } - - .log-message { - padding-left: 50px; - margin: 0; - } - - label { - vertical-align: middle; - margin-right: 15px; - } - - .scroll4::-webkit-scrollbar { - width: 14px; - border: 1px solid black; - } - - .scroll4::-webkit-scrollbar-thumb { - background: #666; - border-radius: 20px; - border: 1px solid black; - } - - .scroll4::-webkit-scrollbar-track { - background: rgb(40, 40, 40); - border: 1px solid black; - } - - #webhooks-log { - - } - - #webhooks-log-container { - background: #272822; - border-radius: 3px; - height: 450px; - color: #cccccc; - overflow-y: auto; - font-family: Consolas, "Courier New", monospace; - font-feature-settings: "liga" off, "calt" off; - font-size: 14px; - line-height: 18px; - box-shadow: 0 25.6px 57.6px rgba(0, 0, 0, .22), 0 4.8px 14.4px rgba(0, 0, 0, .18); - padding: 5px 8px; - } \ No newline at end of file diff --git a/dist.yaml b/dist.yaml new file mode 100644 index 0000000..46f2282 --- /dev/null +++ b/dist.yaml @@ -0,0 +1,2770 @@ +openapi: 3.1.0 +info: + version: 2.0.0 + title: CoinPayments API Documentation + x-logo: + url: ./logo.png + description: > + Welcome to CoinPayments API documentation! + + + ![markdown file changed](./charlie.png) + + + CoinPayments API is a RESTful JSON API for interacting with blockchains, + + accessed over HTTP or HTTPS from the domain + **https://api.coinpayments.net/api/v1/** + + + # Overview + + 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. + + + + # Features + + 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. + + + #### Some of the key features of the website include: + + 1. Support for multiple popular cryptocurrencies, allowing customers to pay + with the digital currency of their choice. + + 2. Generate invoices and manually share them with buyers through a link or + via email. + + 3. Callback Addresses feature allows merchant to receive payment without + specifying the amount or time in advance. + + 4. Real-time updates using Webhooks, The API provides updates on the status + of transactions, allowing merchants and customers to track the progress of + their payments. + + 5. Advanced security measures to ensure that all transactions are safe and + secure. + + + + # Common API Errors + + 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. + + + ### Unauthorized + + 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. + + + ### Insufficient Funds + + 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. + + + ### Invalid Address + + 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 + + + + #### Valid UTXO-Based Coin Addresses: + + - Bitcoin (BTC): `1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2` + + - Bitcoin Cash (BCH): + `bitcoincash:qr7uq7uvujmzhcv29tw92q0hs7fwpht4fvl4a4kj9a` + + - Litecoin (LTC): `LZx9pzGfH6mKSzVsJZnryeVrRzt6X8uZ9r` + + + #### Valid Token Coin Addresses: + + - Ethereum (ETH): `0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf` + + - ERC-20 Tokens (e.g., DAI, USDT): + `0x6B175474E89094C44Da98b954EedeAC495271d0F` + + + + ### Invalid or Unsupported Currency: + + 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. + + + ### Bad request ( Input validation errors ): + + 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. + + + + + # Rate limits + + 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. + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html +tags: + - name: Authentication + description: > + 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. + + + + #### Prerequisites + + 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. + + + + ## Create credentials + + First, you need to [create an + account](https://signin.coinpayments.net/Identity/Account/SignUp?returnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3Dcoinpayments-aphrodite%26response_type%3Did_token%2520token%26scope%3Dopenid%2520profile%2520orion%26redirect_uri%3Dhttps%253A%252F%252Fnew.coinpayments.net%252Fcallback%26nonce%3D5c9d038a-7d3b-410d-345c-1b196492ce13) + + ##### Once you're logged into your account, click on Integrations 👇 + + + ![markdown file changed](./integrations-1.png) + + + + ##### API Integrations 🏗 + + ![markdown file changed](./integration-2.png) + + + + ##### Add integration ➕ + + ![markdown file changed](./integration-3.png) + + + + ##### Give a name and a URL to your integration - more on the URL later. + + ![markdown file changed](./integration-4.png) + + + + + **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. + + + --- + + + ## Generate API Signature + + 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. + + + --- + + + ### X-CoinPayments-Client + + Populate this header with your **CLIENT ID** + + + Example value + + `cc7caaa431d54ad6accfd28b20170ee4` + + + + --- + + ### X-CoinPayments-Timestamp + + Before we Populate this header with the current time as a UNIX timestamp, + exclude the milliseconds epoch, example: + + + ```javascript + + const date = new Date().toISOString().split(".")[0]; + + ``` + + + Example value: + + `2022-12-19T19:27:04` + + --- + + ### Construct the request queryString + + To create an API signature, you first need to construct the query string + which is made of the + + following attributes concatenated together + + * method + + * url + + * clientId + + * date + + + Example ( Javascript ) + + ```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 ) + + ```javascript + + const queryString = `\ufeff${method}${url}${clientId}${''}`; + + ``` + + + --- + + ### X-CoinPayments-Signature + + Next step is to use your `clientSecret` to generate the signature using + SHA-256 encryption algorithm as follows: + + + ```javascript + + 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: + + ```javascript + + const clientId = 'd0ccc52b8204460783d375e278082de2'; + + const clientSecret = 'WYEB+hN+89waO76QeO9T7IIqhdo/60GHrdYu2vEa7Tg='; + + const url = `https://api.coinpayments.net/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); + + ``` + + + + --- + - name: Invoices API + description: >- + CoinPayments exposes invoices API endpoints allowing merchants to + implement a payment gateway on their platform and let + + buyers pay for goods and services in cryptocurrencies supported by the + merchant’s platform. + + With CoinPayments invoices API you may: + - send out invoices to their clients. + - launch an integrated hosted checkout to merchant’s payment flow that will be acting on the whitelabeling basis. + CoinPayment’s invoices API is built around “invoice” entity. In other + words, under the hood it generates an invoice with + + all the buyer’s and merchant’s data plus information on the + product/service. Thus, merchant’s will be flexible in + + managing payments with the help of this data via a set of available + endpoints. + + Below you will find information on how payment flow is organized for each + of the above-mentioned approaches. + + + **Payment Flow for Sent out Invoices** + + + Imagine a case where you have a platform that provides services on + subscription basis. Every month you need to send out + + invoices to your users with the reminder to pay for the subscription. In + order to automate this flow, you may want to + + use CoinPayments API. Here are the steps that should take place in order + payment could occur: + + + 1. Merchant adds details on services for which invoice is issued, + indicates user’s details like name, payment address + + and email + + 2. With the help of Create Invoice endpoint merchant generates an invoice + entity with the data from step 1 and launches + + the payment flow + + 3. As a response to the Create Invoice endpoint, merchant receives all + invoice entity data including: + - paymentId to get payment address and check payment status + - link to the invoice document with the active payment button that would lead user to payment checkout + - date when invoice expires + - array of allowed currencies with currency description, payment amount and fees. + + 4. Link to the invoice is sent to the user’s email address + + 5. User selects currency for payment, which triggers the Get Payment + Address endpoint and merchant receives payment + + address + + 6. After that merchant can check the status of the payment with the help + of Get Payment Status endpoint that includes: + - status of payment + - how much was detected and confirmed on blockchain + - how much was detected but not confirmed yet. + + **Payment Flow for Integrated Checkout with Whitelabeling** + + + Imagine 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 add goods to the + shopping cart, click “pay” and they will be + + forwarded to the payment gateway provided by CoinPayments. Here are the + steps that should take place in order payment + + could occur: + + + 1. Buyer selects product/service on the merchant’s site. + + 2. With the help of Create Invoice endpoint merchant generates an invoice + entity and launches the payment flow. + + 3. As a response to the Create Invoice endpoint, merchant receives all + invoice entity data including: + - paymentId to get payment address and check payment status + - link to the checkout for payment + - date when invoice expires + - array of allowed currencies with currency description, payment amount and fees. + 4. Once buyer clicks “Pay” in your website, they are forwarded to the + CoinPayments checkout window where they select + + currency for payment. This triggers the Get Payment Address endpoint and + merchant receives payment address + + 5. After that merchant can check the status of the payment with the help + of Get Payment Status endpoint that includes: + - status of payment + - how much was detected and confirmed on blockchain + - how much was detected but not confirmed yet. + + Below we will provide you with the detailed information on each of the + invoices endpoints and their field values. + + Although endpoints are the same for both described use-cases, there exists + a slight difference in fields to be used for + + either flow which will be addressed additionally. + - name: Wallets API + description: >+ + The Wallets API enables merchants to create and manage their wallets and + wallet addresses. This is made possible through 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 full control and flexibility in managing + their cryptocurrency wallets to cater to their specific business needs. + + + + **Important Note:** + + + If WebhookUrl field of the body is specified, then the following requests + will be sent to the provided URL (maximum 5 attempts with 5-seconds + timeout for a single request and 1-second delay between retries). All keys + and values of the webhook payloads are strings. Samples of data being + sent: + + + 1- When wallet is activated: + + ```javascript + + { + "eventType" : "walletActivated", + "walletId" : "58f78b24-1de0-42b3-9a48-94f3e9c57752", + "walletAddress" : "0x063c9743195f53c85c8ebbdaa5916da3502b24ac" + } + + ``` + + + + + 2- When funds are received (amount is in currency's smallest units): + + ```javascript + + { + "eventType" : "transferReceived", + "walletId" : "58f78b24-1de0-42b3-9a48-94f3e9c57752", + "currencyId" : "4", + "transactionId" : "f8ea1354-b3c9-470f-af09-c2ba96f2e391" , + "amount" : "1000000000000000000" + } + + ``` + + + + + 3- When sent transaction is confirmed: + + ```javascript + + { + "eventType" : "transferConfirmed", + "fromWalletId" : "58f78b24-1de0-42b3-9a48-94f3e9c57752", + "transactionId" : "f8ea1354-b3c9-470f-af09-c2ba96f2e391", + "spendRequestId" : "c25bb620-ffdd-4b63-9ae6-dd8f2645c8f6", + "txHash" : "0xdb247c2d1db3ee09658bced93761360e24d8fe555b79661f252470305babfd3d", + "block" : "11286611" + } + + ``` + + - name: Webhooks API + description: >- + 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. Currently, CoinPayments supports webhook + notifications for invoices, with plans to extend support to merchant + wallets in the future. + + + It's important to note that 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. + + + Here is a list of invoice events for which merchants can choose to receive + notifications: + + + - **invoiceCreated:** triggered when a new invoice is created + + - **invoicePending:** triggered when an invoice is pending payment + + - **invoicePaid:** triggered when an invoice is successfully paid, a paid + invoice means the funds are received in the seller or merchant's wallet, + however the transaction is not yet settled or confirmed on the blockchain. + + - **invoiceCompleted:** triggered when the invoice is paid **and** the + transaction has aquired the minimum confirmations required to mark it + confirmed. only when an invoice is marked `Completed`, users are free to + use the funds. + + - **invoiceCancelled:** triggered when an invoice is cancelled + + + Merchants have the flexibility to create webhooks either through the + user-friendly UI or via API calls. To create a webhook through the UI, + simply follow these steps: + + + - Access the dashboard and click on "Integrations" in the left sidebar. + + - Choose "API integrations", click "Add New", and provide a name for your + integration client, along with your server URL. + + - On the right side of the popup screen, open the dropdown menu to specify + the events for which you wan- to receive notifications. + + - Click "OK" to confirm your selections. + + + 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. + + + 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 + client intends for their server API to receive notifications upon invoice + completion + + + ![markdown file changed](./webhook-flowchart.png) +servers: + - url: https://api.coinpayments/api/v1 +paths: + /currencies: + get: + tags: + - Currencies API + summary: List currencies and their capabilities + description: >- + Returns a page of the supported currencies on the CoinPayments.net + platform, by default ordered by their rank on CoinPayments.net. + operationId: listPlatformSupportedCurrencies + parameters: + - name: q + in: query + schema: + type: string + example: BTC + description: search query to find currencies by name or symbol + - name: types + in: query + schema: + type: string + example: crypto,token,fiat + description: >- + comma separated list of the types of currencies to return (e.g. + 'coin', 'token', 'fiat', etc.). By default currencies of all types + are returned + - name: capabilities + in: query + schema: + type: string + example: multiSigAccounts,sharedAccounts,payments,singleSigAccounts + description: search query to find currencies by name or symbol + - name: after + in: query + schema: + type: string + example: '' + description: search query to find currencies by name or symbol + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/arrayOfCurrencies' + '400': + description: Bad Request + /currencies/{id}: + get: + tags: + - Currencies API + summary: Get currency by Id + description: | + Get Currency by Id + operationId: getCurrencyById + parameters: + - name: id + in: path + required: true + schema: + type: string + example: '2' + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: '#/components/schemas/currencySchema' + '404': + description: currency not found + /currencies/blockchain-nodes/{id}/latest-block-number: + get: + tags: + - Currencies API + summary: Get latest block number by currency + description: | + Get the latest blockchain block number by currency Id + operationId: getLatestBlockNumberByCurrencyId + parameters: + - name: id + in: path + required: true + schema: + type: string + example: '1' + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: '#/components/schemas/latest-block-number' + '404': + description: Block number not found + /currencies/conversions: + get: + tags: + - Currencies API + summary: Gets a list of all possible currency conversions + description: | + Get a list of all possible currency conversions + operationId: getCurrencyConversions + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: '#/components/schemas/currencyConversions' + '400': + description: Bad request + /merchant/invoices: + post: + tags: + - Invoices API + summary: Create Invoice + operationId: createInvoice + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/invoice' + description: Create Invoice + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/invoiceRes' + '404': + description: Merchant Not Found! + get: + tags: + - Invoices API + summary: Get invoices + description: | + Get list of merchant invoices + operationId: getListOfInvoices + parameters: + - name: clientId + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional clientId field to allow filtering by integration clientId. + - name: status + in: query + schema: + type: string + example: draft, paid, pending, cancelled, completed + description: optional status field to allow filtering by invoice status. + - name: from + in: query + schema: + type: string + example: '2023-01-01' + description: optional "from" field to allow filtering by invoice creation date. + - name: to + in: query + schema: + type: string + example: '2023-01-30' + description: optional "to" field to allow filtering by invoice creation date. + - name: q + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional search string to find invoices with these words. + - name: integration + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional integration field to allow filtering by integration. + - name: payoutWalletId + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: >- + optional query to filter the invoices by the wallet they were paid + out to (for 'paid' and 'completed' invoices). + - name: limit + in: query + schema: + type: integer + example: 10 + description: used to specify the number of records to return in one page. + - name: after + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: >- + used to specify a cursor or marker that indicates the starting point + of the next page of data. + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/invoices' + '404': + description: Merchant Not Found! + /merchant/invoices/{id}: + get: + tags: + - Invoices API + summary: Get invoice by Id + description: | + Get Invoice by Id + operationId: getInvoiceById + parameters: + - name: id + in: path + required: true + schema: + $ref: '#/components/schemas/id' + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: '#/components/schemas/invoice' + '400': + description: Bad request example! + /merchant/invoices/{id}/payouts: + get: + tags: + - Invoices API + summary: Get invoices payouts + description: > + 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. + operationId: getInvoicePayouts + parameters: + - name: id + in: path + required: true + description: invoice Id + schema: + type: string + example: 5xyKTbjTMcbXMUsaprSRaP + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/payouts' + '404': + description: Merchant Not Found! + /merchant/invoices/{id}/hitory: + get: + tags: + - Invoices API + summary: Get invoice history + description: | + List history events of an invoice by the invoice Id + operationId: getInvoiceHistory + parameters: + - name: id + in: path + required: true + schema: + $ref: '#/components/schemas/id' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/invoiceHistory' + '404': + description: Merchant Not Found! + /merchant/wallets: + post: + tags: + - Wallets API + summary: Create wallet + description: > + Creates new wallet by currency Id. Note: you can get the currency Id + from the currencies API. + operationId: createMerchantWallet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MerchantWallet' + description: Create wallet payload + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/NewWallet' + '404': + description: Currency Not Found! + get: + tags: + - Wallets API + summary: Get Wallets + description: >- + Retrieves a list of wallets woth their balances, addresses, statuses and + other info. + operationId: getMerchantWallets + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/arrayOfWallets' + '404': + description: Wallet not found + /merchant/wallets/{walletIdStr}: + get: + tags: + - Wallets API + summary: Get Wallet by Id + description: Retrieves wallet by its Id + operationId: getMerchantWalletById + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the wallet Id + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/MerchantWalletObj' + '404': + description: Wallet not found + /merchant/wallets/{walletIdStr}/addresses: + post: + tags: + - Wallets API + summary: Create address for an existing wallet + description: > + 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. + operationId: createWalletAddress + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the wallet Id + - name: label + in: query + schema: + type: string + example: shop tests address + description: label for the address + responses: + '201': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/addressRes' + '404': + description: Wallet Not Found! + get: + tags: + - Wallets API + summary: Get wallet addresses + description: Retrieves a list of wallet addresses + operationId: getWalletAddresss + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the wallet Id + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/list-of-addresses' + '404': + description: Wallet not found + /merchant/wallets/{walletIdStr}/transactions: + get: + tags: + - Wallets API + summary: Get wallet transactions + description: Retrieves a list of all wallet transactions + operationId: getTransactionsByWalletId + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the wallet Id + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/arrayOfWalletTransactions' + '404': + description: Wallet not found + /merchant/wallets/{walletIdStr}/transaction: + get: + tags: + - Wallets API + summary: Get wallet transaction + description: > + Get a specific transaction of a wallet. This request requires the + walletIdStr URL parameter. Additionally, + + there are two optional query parameters: transactionId and + spendRequestId. + + 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. + operationId: getTransactionByWalletId + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the wallet Id + - name: transactionId + in: query + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the transaction Id + - name: spendRequestId + in: query + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the spend request Id + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/arrayOfWalletTransactions' + '404': + description: Wallet not found + /merchant/wallets/{walletIdStr}/spend/request: + post: + tags: + - Wallets API + summary: Create spend or convert request + description: > + 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" is included in the response from the first + step. + + + +
    + +
    + + + Here's a simplified flowchart explaining the withdrawal/conversion flow: + + + ![markdown file changed](./withdrawal-flowchart.png) + operationId: sendSpendRequest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SpendRequestPayload' + description: Withdrawal Request payload + required: true + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the wallet Id from which you intend to withdraw funds + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/SpendRequestConfirmationSuccess' + '400': + description: Not enough funds + '404': + description: Wallet not found + /merchant/wallets/{walletIdStr}/spend/confirmation: + post: + tags: + - Wallets API + summary: Confirm spend or convert request + description: Send a request to confirm the withdrawal + operationId: spendRequestConfirmation + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + description: the wallet Id from which you intend to withdraw funds + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/SpendRequestConfirmationSuccess' + '404': + description: Spend confirmation not found + $ref: '#/components/responses/Problem' + /merchant/your-server-url: + post: + tags: + - Webhooks API + summary: Notification Payload + description: | + Below is the payload sent from CPs API to your server API + operationId: notificationPayload + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: '#/components/schemas/notification-payload' + '400': + description: CoinPayments API could not reach your server + /merchant/clients/{clientId}/webhooks: + post: + tags: + - Webhooks API + summary: Create client webhook + description: | + Creates new client webhook + operationId: createWebhook + parameters: + - name: clientId + in: path + required: true + description: client Id + schema: + $ref: '#/components/schemas/id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSchema' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/createWebhook' + '404': + description: Merchant Not Found! + get: + tags: + - Webhooks API + summary: Get webhooks of merchant + description: | + Get list of merchant invoices + operationId: getMerchantWebhooks + parameters: + - name: clientId + in: path + required: true + description: client Id + schema: + $ref: '#/components/schemas/id' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/list-webhooks' + '404': + description: Merchant Not Found! + /merchant/clients/{clientId}/webhooks/{webhookId}: + put: + tags: + - Webhooks API + summary: Update Webhook + description: | + Update Webhook by client Id and webhook Id + operationId: updateWebhook + parameters: + - name: clientId + in: path + required: true + description: client Id + schema: + $ref: '#/components/schemas/id' + - name: webhookId + in: path + required: true + description: webhook Id + schema: + $ref: '#/components/schemas/id' + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: '#/components/schemas/webhookSchema' + '404': + description: Wallet not found + delete: + tags: + - Webhooks API + summary: Delete Webhook + description: | + delete a webhook by client Id and webhook Id + operationId: deleteWebhook + parameters: + - name: clientId + in: path + required: true + description: client Id + schema: + $ref: '#/components/schemas/id' + - name: webhookId + in: path + required: true + description: webhook Id + schema: + $ref: '#/components/schemas/id' + responses: + '204': + description: Success status code - no content + '404': + description: Wallet not found + /rates: + get: + tags: + - Rates API + summary: Conversion rates between currencies + description: > + Returns the currency conversion rates for the specified from currencies + converted to the specified to currencies + operationId: getConversionsBetweenTwoCurrencies + parameters: + - name: from + schema: + type: integer + in: query + description: >- + comma separated list of currency ids to use as the source for rate + calculations + required: true + example: 1 + - name: to + schema: + type: integer + in: query + description: >- + comma separated list of currency ids for which to retrieve + conversion rates for (from the from currencies) + - name: fromToken + in: query + schema: + type: integer + description: optional, contract address of the token on the from currency + - name: toToken + in: query + schema: + type: integer + description: optional, contract address of the token on the quote currency + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: '#/components/schemas/ratesRes' + '400': + description: Bad request +components: + securitySchemes: + main_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: http://example.com/api/oauth/dialog + scopes: + read:users: read users info + write:users: modify or remove users + api_key: + type: apiKey + in: header + name: api_key + basic_auth: + type: http + scheme: basic + schemas: + logo: + type: object + description: currency logo / icon + properties: + iamgeUrl: + type: string + vectorUrl: + type: string + urls: + type: object + properties: + websites: + type: array + items: + type: string + example: + - https://bitcoin.org + explorers: + type: array + items: + type: string + example: + - https://blockchain.info + currencySchema: + type: object + properties: + id: + description: currency Id + type: string + example: '1' + type: + description: currency type + type: string + example: crypto + symbol: + description: currency symbol + type: string + example: BTC + name: + description: currency name + type: string + example: Bitcoin + logo: + $ref: '#/components/schemas/logo' + decimalPlaces: + type: integer + example: 0 + rank: + type: integer + example: 0 + status: + type: string + example: active + capabilities: + $ref: '#/components/schemas/urls' + requiredConfirmations: + type: integer + example: 0 + arrayOfCurrencies: + type: array + items: + $ref: '#/components/schemas/currencySchema' + latest-block-number: + type: object + properties: + currencyId: + description: currency Id + type: string + example: '1' + latestBlockNumber: + description: latest block number + type: integer + example: 773862 + currencyConversions: + type: array + items: + type: object + properties: + from: + type: string + example: '4' + to: + type: string + example: '6' + fullName: + type: object + properties: + firstName: + type: string + description: first name of the buyer + lastName: + type: string + description: last name of the buyer + physicalAddress: + type: object + properties: + address1: + type: string + description: main address + address2: + type: string + description: additional address data + address3: + type: string + description: additional address data + provinceOrState: + type: string + description: Province or state of the buyer + city: + type: string + description: city of the buyer + suburbOrDistrict: + type: string + description: Suburb or district of the buyer + countryCode: + type: string + format: US + postalCode: + type: string + format: '10101' + buyer: + type: object + properties: + companyName: + type: string + format: Rushing Turtles + name: + $ref: '#/components/schemas/fullName' + emailAddress: + type: string + description: email address of the buyer + format: johndoe@gmail.com + phoneNumber: + type: string + description: phone number of the buyer + format: '01010101010' + address: + $ref: '#/components/schemas/physicalAddress' + globalAmount: + type: object + properties: + currencyId: + type: string + description: the currency id of the wallet or address into which to payout to + contractAddress: + type: string + description: >- + the address of the contract if this money object represents an ERC20 + or similar token value + displayValue: + type: string + description: The value formatted for display (e.g 0.1234 BTC) + value: + type: string + description: > + This parameter represents the monetary value as an integer in the + base (smallest) unit of the currency. For instance, Bitcoin can be + divided into 8 decimal places, + + with each division known as a Satoshi. Therefore, 1 BTC would have a + value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of + 31,000 Satoshis. Similarly, + + an amount of $9.99 USD would be represented as 999 cents. In the + case of zero-decimal currencies like the Yen, a value of ¥500 would + be represented as 500. + + If no value is provided, the default is 0. + valueAsDecimal: + type: string + description: > + The decimal value represents the monetary value with decimal + precision derived from the value field, which is the integer + representation in the smallest unit of the currency or token. + items: + type: object + description: array of items that a buyer intends to purchase from the merchant + properties: + customId: + type: string + description: item Id in the merchant's system + sku: + type: string + description: item SKU number + name: + type: string + description: name or title of the item + example: Iphone 22 + description: + type: string + description: description of the item + quantity: + type: object + properties: + value: + type: number + description: >- + the quantity of the item. Must be greater than 0 and less than + 999,999,999. Defaults to 1 if not provided + type: + type: string + example: 1 + originalAmount: + $ref: '#/components/schemas/globalAmount' + amount: + $ref: '#/components/schemas/globalAmount' + tax: + $ref: '#/components/schemas/globalAmount' + shipping: + type: object + properties: + method: + type: string + description: Shipment method + companyName: + type: string + description: Company name + name: + $ref: '#/components/schemas/fullName' + emailAddress: + type: string + description: email address + phoneNumber: + type: string + description: phone number + address: + $ref: '#/components/schemas/physicalAddress' + merchantOptions: + type: object + properties: + showAddress: + type: boolean + default: false + showPhone: + type: boolean + default: false + showRegistrationNumber: + type: boolean + default: false + showEmail: + type: boolean + default: false + additionalInfo: + type: string + format: additional Info + notificationUrl: + type: string + example: https://site.com/api/{YOUR_WEBHOOK_PATH} + notifications: + type: array + description: > + specify the event name you want your server to be notified about when it + occurs + + + e.g. send notification when an invoice is created + items: + type: string + example: + - invoiceCreated + - invoicePending + - invoicePaid + - invoiceCompleted + - invoiceCancelled + webhookSchema: + type: object + required: + - notifications + - notificationsUrl + properties: + notificationsUrl: + $ref: '#/components/schemas/notificationUrl' + notifications: + $ref: '#/components/schemas/notifications' + invoice: + type: object + description: > + 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 + required: + - amount + properties: + isEmailDelivery: + type: boolean + description: >- + default value to be used for whitelabeling checkout flow. For + invoice document delivery indicates if invoice will be email + delivered + default: false + emailDelivery: + type: object + description: email addresses to be used for invoice delivery + properties: + to: + type: string + description: >- + to email address. The value can take multiple addresses + separated by semicolons + cc: + type: string + description: field to add multiple recipients separated by semicolons + bcc: + type: string + description: >- + bcc field similar to "cc" field except that other recipients + won't be able to see that someone else has been sent a copy of + the email + dueDate: + type: string + example: '2023-04-26T18:40:41.322Z' + description: >- + to be used for invoice doc delivery. Date when invoice is to be + mailed out to the user + invoiceDate: + type: string + example: '2022-11-28T13:59:46+00:00' + description: to be used for invoice doc. Date when invoice was issued + draft: + type: boolean + description: >- + Default value to be used for whitelabeling checkout flow. flag + indicating whether this is a draft invoice + default: false + clientId: + type: string + description: the id of the client (merchant) creating this invoice + invoiceId: + type: string + description: >- + default value to be used for whitelabeling checkout flow. For + invoice document delivery invoice number assigned by the merchant + default: false + buyer: + $ref: '#/components/schemas/buyer' + description: + type: string + description: the purchase description, can be provided instead of a list of items + items: + type: array + items: + $ref: '#/components/schemas/items' + amount: + type: object + description: | + detailed amount of purchase with the breakdown of all fees + properties: + breakdown: + type: object + properties: + subtotal: + $ref: '#/components/schemas/globalAmount' + shipping: + $ref: '#/components/schemas/globalAmount' + handling: + $ref: '#/components/schemas/globalAmount' + taxTotal: + $ref: '#/components/schemas/globalAmount' + discount: + $ref: '#/components/schemas/globalAmount' + currencyId: + type: string + description: original currency Id of the item + contractAddress: + type: string + description: >- + the address of the contract if this money object represents an + ERC20 or similar token value + displayValue: + type: string + description: the value formatted for display (e.g 0.1234 BTC) + value: + type: string + description: > + this parameter represents the monetary value as an integer in + the base (smallest) unit of the currency. For instance, Bitcoin + can be divided into 8 decimal places, + + with each division known as a Satoshi. Therefore, 1 BTC would + have a value of 100,000,000 Satoshis, and 0.00031 BTC would have + a value of 31,000 Satoshis. Similarly, + + an amount of $9.99 USD would be represented as 999 cents. In the + case of zero-decimal currencies like the Yen, a value of ¥500 + would be represented as 500. + + If no value is provided, the default is 0 + valueAsDecimal: + type: string + description: > + The decimal value represents the monetary value with decimal + precision derived from the value field, + + which is the integer representation in the smallest unit of the + currency or token. + shipping: + $ref: '#/components/schemas/shipping' + requireBuyerNameAndEmail: + type: boolean + description: >- + flag indicating whether a buyer name and email are required, they + will be requested at checkout if not provider by the caller. + buyerDataCollectionMessage: + type: string + description: the message to display when collecting buyer user data + notes: + type: string + description: notes for the merchant only, these are not visible to the buyers + notesToRecipient: + type: string + description: >- + any additional information to share with the buyer about the + transaction + termsAndConditions: + type: string + description: any terms and conditions, e.g. a cancellation policy + merchantOptions: + $ref: '#/components/schemas/merchantOptions' + customData: + type: object + description: >- + any custom data merchant wishes to attach to the invoice that may be + further used for custom merchant's purposes. Not visible on UI for + buyers + properties: + additionalProp1: + type: string + additionalProp2: + type: string + additionalProp3: + type: string + metadata: + type: object + properties: + integration: + type: string + description: integration name + format: InvoiceBuilder + hostname: + type: string + description: server name of the integration API + poNumber: + type: string + description: optional Purchase order number on the integration API. + format: InvoiceBuilder + webhooks: + $ref: '#/components/schemas/webhookSchema' + payoutConfig: + type: object + description: >- + configs for payout for this particular invoice. Overrides account + payout configs + properties: + currencyId: + type: string + description: the currency Id of the wallet or address into which to payout to + contractAddress: + type: string + description: >- + the address of the contract if this money object represents an + ERC20 or similar token value + address: + type: string + description: the external address into which to pay out to + frequency: + type: array + description: frequency of payout execution + example: + - normal + - asSoonAsPossible + - hourly + - nightly + - weekly + payment: + type: object + description: >- + is used for white labeling checkout mode. Defines additional data + required for this type of payments + properties: + refundEmail: + type: string + description: >- + Is used for white labeling checkout mode. Email of the payer for + possible refund in case there is a problem with payment + invoices: + type: array + items: + $ref: '#/components/schemas/invoice' + invoiceRes: + type: object + properties: + id: + type: string + description: the CoinPayments id of the invoice + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + id: + type: string + example: nKCMuD6h3Vsgs4mGDqGeV + txId-or-hash: + type: string + format: '0x2446f1fd773fbb9f080e674b60c6a033c7ed7427b8b9413cf28a2a4a6da9b56c' + currencyId: + type: string + description: the currency id of the wallet or address into which to payout to + example: '1' + paidTransaction: + type: object + properties: + hash: + $ref: '#/components/schemas/txId-or-hash' + amount: + type: object + properties: + displayValue: + type: string + description: The value formatted for display (e.g 0.1234 BTC) + value: + type: string + description: > + This parameter represents the monetary value as an integer in + the base (smallest) unit of the currency. For instance, Bitcoin + can be divided into 8 decimal places, + + with each division known as a Satoshi. Therefore, 1 BTC would + have a value of 100,000,000 Satoshis, and 0.00031 BTC would have + a value of 31,000 Satoshis. Similarly, + + an amount of $9.99 USD would be represented as 999 cents. In the + case of zero-decimal currencies like the Yen, a value of ¥500 + would be represented as 500. + + If no value is provided, the default is 0. + currencyId: + $ref: '#/components/schemas/currencyId' + conversionId: + type: number + example: 0 + amount: + type: object + properties: + displayValue: + type: string + description: The value formatted for display (e.g 0.1234 BTC) + value: + type: string + description: > + This parameter represents the monetary value as an integer in the + base (smallest) unit of the currency. For instance, Bitcoin can be + divided into 8 decimal places, + + with each division known as a Satoshi. Therefore, 1 BTC would have a + value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of + 31,000 Satoshis. Similarly, + + an amount of $9.99 USD would be represented as 999 cents. In the + case of zero-decimal currencies like the Yen, a value of ¥500 would + be represented as 500. + + If no value is provided, the default is 0. + currencyId: + $ref: '#/components/schemas/currencyId' + destinationAmount: + type: object + properties: + amount: + $ref: '#/components/schemas/amount' + nativeAmount: + $ref: '#/components/schemas/amount' + currency: + type: object + properties: + id: + description: the unique id of the currency on the CoinPayments platform + $ref: '#/components/schemas/id' + type: + type: string + description: the type of the currency (e.g crypto, token or fiat ) + symbol: + type: string + description: > + ticker symbol for the currency. For fiat currencies this is the + three character (ISO-4217) currency code, + + and for crypto currencies their multi-character symbol. + example: BTC + name: + type: string + description: the name of the currency, e.g. 'United States Dollar' or 'Bitcoin' + logo: + type: object + description: the logo urls for the currency + properties: + imageUrl: + type: string + description: > + 'Link to a CoinPayments hosted image for a currency, 64x64 is + the default size returned.' + Replace "64x64" in the image url with these alternative sizes: 32, 64, 128, 200. + vectorUrl: + type: string + description: >- + If available then the link to a CoinPayments hosted vector image + (SVG) for the currency. + decimalPlaces: + type: number + description: >- + the number of digits after the decimal separator, e.g. 2 for USD, 8 + for BTC, 0 for JPY + example: 0 + rank: + type: number + description: >- + the relative ordering/ranking of this currency to the other + supported currencies on the CoinPayments platform + example: 0 + capabilities: + type: array + description: > + the capabilities of the currency on the CoinPayments platform: + + - multiSigAccounts: Multi signature 2-of-3 wallets where the user + holds the private key + + - sharedAccounts: Shared accounts where the keys are held on the + server only + + - payments: Can be accepted as payments + + - singleSigAccounts: Single signature account for personal use. + items: + type: string + example: multiSigAccounts + urls: + type: object + description: Contains various URLs for a currency + properties: + websites: + type: array + description: the official websites for the currency + items: + type: string + explorers: + type: array + description: the explorers for the currency (if crypto or a token) + items: + type: string + address: + type: string + example: mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9 + fees: + type: object + properties: + displayValue: + type: string + description: The value formatted for display (e.g 0.1234 BTC) + contractAddress: + description: >- + the address of the contract if this money object represents an ERC20 + or similar token value + $ref: '#/components/schemas/address' + value: + type: string + description: > + This parameter represents the monetary value as an integer in the + base (smallest) unit of the currency. For instance, Bitcoin can be + divided into 8 decimal places, + + with each division known as a Satoshi. Therefore, 1 BTC would have a + value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of + 31,000 Satoshis. Similarly, + + an amount of $9.99 USD would be represented as 999 cents. In the + case of zero-decimal currencies like the Yen, a value of ¥500 would + be represented as 500. + + If no value is provided, the default is 0. + currencyId: + $ref: '#/components/schemas/currencyId' + simulateFees: + type: object + properties: + displayValue: + type: string + contractAddress: + $ref: '#/components/schemas/address' + value: + type: string + currencyId: + $ref: '#/components/schemas/currencyId' + merchantFees: + type: object + properties: + transactionFees: + $ref: '#/components/schemas/fees' + networkFee: + description: >- + An object with the same fields as the fees object in the + "transactionFee" + $ref: '#/components/schemas/simulateFees' + conversionFee: + description: >- + An object with the same fields as the fees object in the + "transactionFee" + $ref: '#/components/schemas/simulateFees' + datetime: + type: string + example: '2022-11-29T19:10:04.228Z' + item: + type: object + properties: + currency: + description: the currency (merchant's accepted currency) that will be received + $ref: '#/components/schemas/currency' + merchantFees: + description: The amount for service fees in the merchant's accepted currency + $ref: '#/components/schemas/merchantFees' + payoutAmount: + description: > + This is the amount to be finally paid out to the merchant in the + merchant's accepted currency. + + An object with the same fields and desription as the fees object in + the "transactionFee" under merchantFees. + $ref: '#/components/schemas/simulateFees' + payoutAmountInInvoiceCurrency: + description: > + The Pay out amount in the invoice currency. + + An object with the same fields and desription as the fees object in + the "transactionFee" under merchantFees. + $ref: '#/components/schemas/simulateFees' + merchantFeestInInvoiceCurrency: + description: > + The merchant fees in the invoice currency. + + An object with the same fields as the fees object in the + "transactionFee" under merchantFees. + $ref: '#/components/schemas/simulateFees' + merchantPayoutAddress: + type: string + description: >- + the merchant's payment output address at the time the hot wallet was + created + sent: + description: >- + the timestamp of when this payout was sent (e.g. broadcast on the + blockchain) + $ref: '#/components/schemas/datetime' + created: + $ref: '#/components/schemas/datetime' + expected: + description: >- + the approximate timestamp of when this payout is expected to be sent + (e.g. broadcast on the blockchain) + $ref: '#/components/schemas/datetime' + confirmed: + description: >- + the timestamp of when this payout was confirmed (e.g. on the + blockchain) + $ref: '#/components/schemas/datetime' + state: + type: string + description: the current state of the payout + payouts: + type: object + properties: + paidTransactions: + type: array + description: >- + An array of paid transaction details, including transaction hash, + amount, and conversion Id. + items: + $ref: '#/components/schemas/paidTransaction' + paidDate: + type: string + description: The date and time when the payment was made. + format: '2022-11-29T12:42:44.513Z' + completedTxId: + type: string + description: The ID of the completed transaction. + format: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + externalAddress: + type: string + description: The external address where the payout is deposited + format: 378a37b57b6b4a4a93fd352b06ce1829 + destinationCurrencyId: + type: string + description: The currency ID of the destination address for the payout + format: '1' + expectedDisplayValue: + type: string + description: The expected amount of the payout. + format: '0.01' + sourceCurrencyId: + type: string + description: The ID of the source currency for the payout + format: '101' + destinationAccountId: + type: string + description: The ID of the destination account for the payout + format: 378a37b57b6b4a4a93fd352b06ce1829 + isConversion: + type: boolean + description: Indicates whether a currency conversion is involved in the payout + example: false + conversionProgress: + type: string + description: The progress status of the currency conversion + example: 0 + settlementModeErrorCode: + type: number + example: 0 + destinationAmount: + description: >- + The destination amount of the payout, including the ammount in the + buyer's currency (amount) and the amount in the seller's currency + (nativeAmount) + $ref: '#/components/schemas/destinationAmount' + items: + type: array + items: + $ref: '#/components/schemas/item' + invoiceHistoryItems: + type: object + properties: + timestamp: + type: string + description: the timestamp of when the this event was observed + example: '2023-05-29T19:58:50.043Z' + eventType: + type: string + description: the type of event that was observed + paging: + type: object + properties: + cursor: + type: object + properties: + before: + type: string + after: + type: string + limit: + type: integer + example: 0 + first: + type: string + next: + type: string + previous: + type: string + last: + type: string + invoiceHistory: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/invoiceHistoryItems' + paging: + $ref: '#/components/schemas/paging' + MerchantWalletObj: + type: object + properties: + walletId: + description: Id of the wallet + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + currencyId: + description: Id of the currency which this wallet was created for + type: number + example: 1 + label: + description: label of the wallet + type: string + example: John's wallet + balance: + description: balance of the wallet in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.874833322' + tokenBalances: + description: >- + token (e.g. ERC20) balances for this wallet if available in smallest + units (e.g. Weis for Ethereum) + type: string + example: '0xdac17f958d2ee523a2206206994597c13d831ec7' + depositAddress: + description: blockchain address of this wallet allowing it to receive funds + type: string + example: '0x9939b7b208012cd0395d1411272be6e34c04af7b' + walletStatus: + description: > + status of the wallet, should be Active (2) for valid usable wallets. + + walletStatues can hold one of the following values [Created, Active, + Deactivated or Deleted] + type: string + example: Active + canCreateAddress: + description: >- + specifies whether this wallet is allowed to create additional + deposit addresses + type: boolean + example: true + updatedAt: + description: the date when the properties of the wallet were last updated + type: string + example: '2022-10-05T06:05:07.520Z' + isVaultLocked: + description: flag that determines if the wallet vault is locked or not + type: boolean + example: true + vaultLockoutEndDateTime: + description: >- + when used, the vault will start the countdown to unlock when when + the specified date and time is reached + type: string + example: '2023-07-04T22:21:41.535Z' + arrayOfWallets: + type: array + items: + $ref: '#/components/schemas/MerchantWalletObj' + MerchantWallet: + type: object + required: + - currencyId + - label + properties: + currencyId: + description: user supplied currencyId + type: number + example: 1 + label: + description: Label denoting the wallet + type: string + example: John's wallet + webhookUrl: + description: >- + when provided, CoinPayments API will be sending notifications to + this URL when withdrawals are processed or when funds are moved + type: string + example: https://myapi.com + NewWallet: + type: object + properties: + walletId: + description: Id of newly created wallet + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + address: + description: deposit address + type: string + example: LaN1Vy2FugxWiAyMc8ipKe6Hcnh3mcKuym + addressRes: + type: object + properties: + addressId: + description: Id of newly created address + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + networkAddress: + description: the network address that was created. + type: string + example: LNUPQLeQFfF67RtH1dqFBiwJhYBNZCW7pm + list-of-addresses: + type: array + items: + $ref: '#/components/schemas/addressRes' + WalletTransactionObj: + type: object + properties: + id: + description: Id of the transaction in the system + type: string + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + dateCreated: + description: Date when transaction was created + type: string + example: '2022-10-05T08:39:41.494Z' + dateCompleted: + description: Date when transaction was received or sent to the chain + type: string + example: '2022-10-05T08:40:41.494Z' + fromOwnerId: + description: Id of the owner of the wallet who sent the transaction + type: string + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + fromWalletId: + description: Id of the wallet which the transaction was sent from + type: string + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + toWalletId: + description: Id of the wallet which the transaction was sent to + type: string + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + fromCurrencyId: + description: Id of the currency that was used to send this transaction + type: number + example: 1 + toCurrencyId: + description: Id of the currency which this transaction is sending funds to + type: number + example: 2 + fromAmount: + description: >- + Amount of funds that was sent in this transaction in smallest units + (e.g. Satoshis for Bitcoin) + type: string + example: '0.22390234' + toAmount: + description: >- + Amount of funds that was received in this transaction in smallest + units (e.g. Satoshis for Bitcoin) + type: string + example: '0.13448434' + fromAddress: + description: >- + Address of the wallet which was used when this transaction was + created + type: string + example: 1AYASDI34W2W2SIFFRE32452S1Q + toAddress: + description: Address which this transaction is sending funds to + type: string + example: 1AYASDI34W2W2SIFFRE32452S1Q + fromContractAddress: + description: >- + Address of the sender contract. e.g. + "0xdac17f958d2ee523a2206206994597c13d831ec7" for ERC20 TetherUSD + type: string + example: '0xdac17f958d2ee523a2206206994597c13d831ec7' + toContractAddress: + description: >- + Address of the reciever contract. e.g. + "0xdac17f958d2ee523a2206206994597c13d831ec7" for ERC20 TetherUSD + type: string + example: '0xdac17f958d2ee523a2206206994597c13d831ec7' + confirmations: + description: Current number of confirmations that this transaction has + type: number + example: 2 + requiredConfirmations: + description: >- + Required number of confirmations to consider this transaction + confirmed + type: number + example: 5 + spendRequestId: + description: Id of the spend request which was used to create this transaction + type: string + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + coinPaymentsFee: + description: >- + Amount of funds withheld as system fee for this transaction in + smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.000012' + transactionStatus: + description: Status of this transaction + type: string + example: unknown + transactionType: + description: Type of this transaction + type: string + example: unknown + memo: + description: User-defined custom note for this transaction + type: string + example: July rent + txHash: + description: Blockchain transaction hash (only for external transfers) + type: string + example: 1AYASDI34W2W2SIFFRE32452S1Q3289y7debugDSDSd38d3xSSA33ASDRxw98 + outputIndex: + description: >- + Index of the output in which this transaction receives funds (only + for UTXO received transactions) + type: number + example: 1 + blockchainFee: + description: >- + Amount of funds spent as a blockchain fee for this transaction in + smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.00000032' + feeCurrency: + description: >- + Currency in which CoinPayments fees were deducted. The format is + {CurrencyId}:{ContractAddress} where ContractAddress is optional + e.g.null "1", "4:0xdac17f958d2ee523a2206206994597c13d831ec7" + type: string + example: '0.00000032' + blockNumberTxAppearedAt: + description: date of appearing the transaction in the blockchain + type: string + example: '2022-10-05T08:40:41.494Z' + arrayOfWalletTransactions: + type: array + items: + $ref: '#/components/schemas/WalletTransactionObj' + SpendRequestPayload: + type: object + required: + - toCurrencyId + - amountInSmallestUnits + - toAddress + properties: + fromContractAddress: + description: >- + Address of the contract e.g. + "0xdac17f958d2ee523a2206206994597c13d831ec7" for ERC20 TetherUSD + type: string + example: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' + toContractAddress: + description: >- + Address of the contract of the CurrencyId e.g. + "0xdac17f958d2ee523a2206206994597c13d831ec7" for ERC20 TetherUSD + type: string + example: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' + toAddress: + description: Address which client wants to send funds to + type: string + example: mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9 + toCurrencyId: + description: currency Id of benificiary wallet + type: number + example: 6 + amountInSmallestUnits: + description: > + refers to the amount of a specific cryptocurrency, such as Bitcoin, + measured in its smallest divisible unit, AKA atomic units + + (e.g., Satoshis for Bitcoin). + + It allows for precise and detailed transactions by specifying the + amount in the smallest possible denomination. + + This approach enables you to send fractional amounts of the currency + accurately. + type: string + example: '9900000' + blockchainFeeOverrideInSmallestUnits: + description: >- + Used for overriding the system suggested blockchain fee (within 10% + range) to manage the transaction processing speed + type: number + example: '0.0003234' + memo: + description: user-defined note for the spend + type: string + receiverPaysFee: + description: > + When set to true, the receiver of the conversion will pay the fees. + In this case, + + the AmountInSmallestUnits will be deducted from the source balance, + and the receiver will receive the remaining amount after deducting + the fees. + + When set to false (or not provided), the fees will be added to the + AmountInSmallestUnits, + + and the total sum (including fees) will be deducted from the source + balance. + + The receiver will receive the AmountInSmallestUnits exactly as + specified. + type: boolean + example: false + SpendRequestConfirmationSuccess: + type: object + properties: + spendRequestId: + description: Id of spend request + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + fromWalletId: + description: Id of wallet from which the amount is to be deducted + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + fromContractAddress: + description: >- + Address of the contract (if the withdrawal is from a contract + wallet) + type: string + example: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' + fromCurrencyId: + description: Id of the currency from which the amount is to be deducted + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + toAddress: + description: Address to which the amount is to be transferred + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + toContractAddress: + description: Address of the contract (if the withdrawal is to a contract wallet) + type: string + example: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' + toCurrencyId: + description: Id of the currency to which the amount is to be transferred + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + blockchainFee: + description: Fee to be paid to the blockchain + type: number + example: 0.0001 + coinpaymentsFee: + description: Fee to be paid to coinpayments + type: number + example: 0.0001 + fromAmount: + description: Amount to be deducted from the wallet + type: number + example: 0.0987 + toAmount: + description: Amount to be transferred to the address + type: number + example: 0.0123 + memo: + description: Optional user-defined note for the spend + type: string + example: This is a memo + Problem: + type: object + additionalProperties: true + minProperties: 1 + description: >- + The Problem Details JSON Object + [[RFC7807](https://tools.ietf.org/html/rfc7807)]. + properties: + type: + type: string + description: >- + A URI reference [[RFC3986](https://tools.ietf.org/html/rfc3986)] + that identifies the problem type. It should provide human-readable + documentation for the problem type. When this member is not present, + its value is assumed to be "about:blank". + format: uri + title: + type: string + description: >- + A short, human-readable summary of the problem type. It SHOULD NOT + change from occurrence to occurrence of the problem, except for + purposes of localization. + status: + type: integer + description: The HTTP status code. + minimum: 400 + maximum: 599 + detail: + type: string + description: >- + A human-readable explanation specific to this occurrence of the + problem. + instance: + type: string + description: >- + A URI reference that identifies the specific occurrence of the + problem. It may or may not yield further information if + dereferenced. + notification-payload: + type: object + properties: + id: + description: callback address id + type: string + example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: + description: event type ( e.g "invoiceCreated", "invoiceComplete",.. ) + type: string + example: invoiceCreated + timestamp: + description: date and time of creating the callback address + type: string + example: 2023-04-07T06:58:19.9798764+00:0 + invoice: + $ref: '#/components/schemas/invoice' + itemRes: + type: object + properties: + id: + $ref: '#/components/schemas/id' + notificationUrl: + $ref: '#/components/schemas/notificationUrl' + notifications: + $ref: '#/components/schemas/notifications' + paging: + $ref: '#/components/schemas/paging' + list-webhooks: + type: object + properties: + items: + $ref: '#/components/schemas/itemRes' + createWebhook: + type: object + properties: + id: + type: string + description: webhook id + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + rateItemRes: + type: object + properties: + baseCurrencyId: + type: number + description: the currency code of the source/base currency + example: 1 + quoteCurrencyId: + type: number + description: the currency code of the target/quoted currency + rate: + type: string + description: >- + the conversion rate to convert from BaseCurrencyId into + QuoteCurrencyId + baseToken: + type: string + description: >- + the contract address of the source/base token on the base currency + platform + quoteToken: + type: string + description: >- + the contract address of the target/quoted token on the quoted + currency platform + ratesRes: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/rateItemRes' + responses: + Problem: + description: Problem + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' diff --git a/docs/charlie.png b/docs/charlie.png new file mode 100644 index 0000000..0abbcc2 Binary files /dev/null and b/docs/charlie.png differ diff --git a/docs/free-ltct.png b/docs/free-ltct.png new file mode 100644 index 0000000..17b0165 Binary files /dev/null and b/docs/free-ltct.png differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..3783f0e --- /dev/null +++ b/docs/index.html @@ -0,0 +1,25 @@ + + + + + CoinPayments API + + + + + + + {{{redocHead}}} + + + {{{redocHTML}}} + + diff --git a/docs/integration-2.png b/docs/integration-2.png new file mode 100644 index 0000000..2c0fa09 Binary files /dev/null and b/docs/integration-2.png differ diff --git a/docs/integration-3.png b/docs/integration-3.png new file mode 100644 index 0000000..8fca18b Binary files /dev/null and b/docs/integration-3.png differ diff --git a/docs/integration-4.png b/docs/integration-4.png new file mode 100644 index 0000000..394e28b Binary files /dev/null and b/docs/integration-4.png differ diff --git a/docs/integrations-1.png b/docs/integrations-1.png new file mode 100644 index 0000000..f1ef7d9 Binary files /dev/null and b/docs/integrations-1.png differ diff --git a/docs/invoice-checkout.png b/docs/invoice-checkout.png new file mode 100644 index 0000000..f46868f Binary files /dev/null and b/docs/invoice-checkout.png differ diff --git a/docs/legacy-dashboard.png b/docs/legacy-dashboard.png new file mode 100644 index 0000000..220d1ec Binary files /dev/null and b/docs/legacy-dashboard.png differ diff --git a/docs/logo-2.png b/docs/logo-2.png new file mode 100644 index 0000000..1e865e1 Binary files /dev/null and b/docs/logo-2.png differ diff --git a/docs/logo.png b/docs/logo.png new file mode 100644 index 0000000..1e865e1 Binary files /dev/null and b/docs/logo.png differ diff --git a/docs/mermaid-invoice.png b/docs/mermaid-invoice.png new file mode 100644 index 0000000..8a55829 Binary files /dev/null and b/docs/mermaid-invoice.png differ diff --git a/docs/mermaid-withdrawal-svg.svg b/docs/mermaid-withdrawal-svg.svg new file mode 100644 index 0000000..5f6a2ef --- /dev/null +++ b/docs/mermaid-withdrawal-svg.svg @@ -0,0 +1 @@ +
    Process and validate the transaction
    Review transaction details
    Approve
    Disapprove
    Start
    Spend Request
    Wallets API
    Spend request confirmation
    User
    Transaction details
    User
    End - Disregard
    Confirm spending funds
    Wallets API
    Broadcast transaction
    End
    \ No newline at end of file diff --git a/docs/payouts.png b/docs/payouts.png new file mode 100644 index 0000000..cb31706 Binary files /dev/null and b/docs/payouts.png differ diff --git a/docs/postman-1.png b/docs/postman-1.png new file mode 100644 index 0000000..67325f5 Binary files /dev/null and b/docs/postman-1.png differ diff --git a/docs/postman-2.png b/docs/postman-2.png new file mode 100644 index 0000000..b704ffc Binary files /dev/null and b/docs/postman-2.png differ diff --git a/docs/tab-logo.svg b/docs/tab-logo.svg new file mode 100644 index 0000000..02e10eb --- /dev/null +++ b/docs/tab-logo.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/webhooks-flowchart.png b/docs/webhooks-flowchart.png new file mode 100644 index 0000000..ee7c785 Binary files /dev/null and b/docs/webhooks-flowchart.png differ diff --git a/docs/withdrawal-flowchart.png b/docs/withdrawal-flowchart.png new file mode 100644 index 0000000..4bd9662 Binary files /dev/null and b/docs/withdrawal-flowchart.png differ diff --git a/index.html b/index.html deleted file mode 100644 index bfad8f4..0000000 --- a/index.html +++ /dev/null @@ -1,18060 +0,0 @@ - - - - - - CoinPayments API - - - - - - - - - - - - - - - - - - -
    -
    - -
    -
    - - - - - - - -
    -
    -
    -
    -
    -
    -

    CoinPayments API - ( - v1 - )

    -

    Download OpenAPI specification:Download

    -
    -
    -

    CoinPayments Backend API.

    -
    -
    -
    -
    -
    -
    -
    -

    Authentication -

    -
    -
    -
    -
    -
    -

    oauth2 -

    -
    -
    - - - - - - - - - - - -
    Security Scheme Type - OAuth2 - -
    - implicit - OAuth Flow -
    Authorization URL: - https://signin.coinpayments.net/connect/authorize
    -
    Scopes:
    -
      -
    • orion - -

      Access to coinpayments apis

      -
    • -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Accounts

    -
    -
    -
    -
    -
    -
    -

    lists the financial account balances - grouped by the currency - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/accounts/balances - -
    -
    -
    -
    -
    -
    /api/v1/accounts/balances
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    lists all the user's financial accounts - -

    -
    -
    -

    Returns a page of the financial accounts that the authorized consumer has access to. Accounts can - represent crypto and token wallets (including multi-signature and shared wallets) or fiat currency - accounts.

    -
    -
    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - - - - - -
    currencyId -
    -
    integer - < - int32 - > -
    -
    -
    -

    optional id of the currency to filter the accounts by

    -
    -
    -
    -
    withBalance -
    -
    boolean
    -
    -
    -

    optional to query accounts either with a balance or for those that are empty

    -
    -
    -
    -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/accounts - -
    -
    -
    -
    -
    -
    /api/v1/accounts
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    lists all the user accounts - deposit addresses, ordering by newest first - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string - < - uuid - > -
    -
    -
    -

    the id of the account for which to get addresses for

    -
    -
    -
    -
    -
    -
    -
    query - Parameters
    - - - - - - - - - - - -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/accounts/{id}/addresses - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/addresses
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to create a - new address for an account - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the account to retrieve

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - -
    label -
    -
    string - Nullable -
    -
    -
    -

    the optional label for the new address

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/{id}/addresses - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/addresses
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "label": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    finds an - address by its id or network address - -

    -
    -
    path - Parameters
    - - - - - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the account the address belongs

    -
    -
    -
    -
    addressId
    required -
    -
    -
    -
    string
    -
    -
    -

    the id of the address to retrieve

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/accounts/{id}/addresses/{addressId} - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/addresses/{addressId}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to change the - account label - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the account to retrieve

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - -
    label -
    -
    string - Nullable -
    -
    -
    -

    The new label for the account

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/accounts/{id}/label - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/label
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "label": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a - request to change the address label - -

    -
    -
    path - Parameters
    - - - - - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the account to retrieve

    -
    -
    -
    -
    addressId
    required -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - -
    label -
    -
    string - Nullable -
    -
    -
    -

    The new label for the address

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/accounts/{id}/addresses/{addressId}/label - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/addresses/{addressId}/label
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "label": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    finds an account - by its id - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the account to retrieve

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/accounts/{id} - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to delete a singlesig - financial account - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - delete /api/v1/accounts/{id} - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to add or update an - accounts client keys. Update happens when user changes their account password. - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the account to update the client key for

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - -
    clientPublicKey -
    -
    string - Nullable -
    -
    -
    -

    the clients public key

    -
    -
    -
    -
    clientEncryptedPrivateKey
    required
    -
    -
    -
    string
    -
    -
    -

    the clients encrypted private key

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/accounts/{id}/keys - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/keys
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "clientPublicKey": "string",
    • "clientEncryptedPrivateKey": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    <no - summary> - -

    -
    -
    path - Parameters
    - - - - - - - - - - - -
    masterKeyId
    required -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    currencyId
    required -
    -
    -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/accounts/fee/{masterKeyId}/{currencyId} - -
    -
    -
    -
    -
    -
    /api/v1/accounts/fee/{masterKeyId}/{currencyId}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    validates a request to - spend funds from the account - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    -

    the details of the spend request, including the recipients the amount to send to each

    -
    - - - - - - - - - - - - - - - -
    recipients - - -
    required
    -
    -
    -
    Array of objects ( - AccountSpendRequestRecipientDto - )
    -
    -
    -

    the list of recipients to send funds to

    -
    -
    -
    -
    memo -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    Custom memo to attach to this transaction, this will only be visible within CoinPayments® -

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    Optional additional information for the spend request e.g. "UseHopAddress" for - Ethereum

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/{id}/spend/validate - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/spend/validate
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "recipients":
      [
      ],
    • "memo": "string",
    • "customData":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    validates a - request to spend all funds from the account - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    -

    the details of the spend request

    -
    - - - - - - - - - - - - - - - -
    recipients - - -
    required
    -
    -
    -
    Array of objects ( - AccountSpendRequestRecipientDto - )
    -
    -
    -

    the list of recipients to send funds to

    -
    -
    -
    -
    memo -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    Custom memo to attach to this transaction, this will only be visible within CoinPayments® -

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    Optional additional information for the spend request e.g. "UseHopAddress" for - Ethereum

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/{id}/spend/all/validate - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/spend/all/validate
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "recipients":
      [
      ],
    • "memo": "string",
    • "customData":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to spend funds - from the account - -

    -
    -
    -

    if approval is required then the request will first be sent to account administrators for approval - before it's actually sent out

    -
    -
    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the account from which to spend funds from

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    -

    the details of the spend request, including the recipients the amount to send to each

    -
    - - - - - - - - - - - - - - - -
    recipients - - -
    required
    -
    -
    -
    Array of objects ( - AccountSpendRequestRecipientDto - )
    -
    -
    -

    the list of recipients to send funds to

    -
    -
    -
    -
    memo -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    Custom memo to attach to this transaction, this will only be visible within CoinPayments® -

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    Optional additional information for the spend request e.g. "UseHopAddress" for - Ethereum

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/{id}/spend - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/spend
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "recipients":
      [
      ],
    • "memo": "string",
    • "customData":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    <no summary> - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - -
    recipients - - -
    required
    -
    -
    -
    Array of objects ( - AccountSpendRequestRecipientDto - )
    -
    -
    -

    the list of recipients to send funds to

    -
    -
    -
    -
    memo -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    Custom memo to attach to this transaction, this will only be visible within CoinPayments® -

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    Optional additional information for the spend request e.g. "UseHopAddress" for - Ethereum

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/{id}/spend/all - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/spend/all
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "recipients":
      [
      ],
    • "memo": "string",
    • "customData":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    <no summary> - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    convertToCurrency
    - required
    -
    -
    -
    integer - < - int32 - > -
    -
    -
    -

    Currency into which funds should be converted

    -
    -
    -
    -
    convertToContractAddress -
    -
    string - Nullable -
    -
    -
    -

    Address of the contract of the token to convert to

    -
    -
    -
    -
    recipients - - -
    required
    -
    -
    -
    Array of objects ( - AccountSpendRequestRecipientDto - )
    -
    -
    -

    the list of recipients to send funds to

    -
    -
    -
    -
    memo -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    Custom memo to attach to this transaction, this will only be visible within CoinPayments® -

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    Optional additional information for the spend request e.g. "UseHopAddress" for - Ethereum

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/{id}/convert - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/convert
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "convertToCurrency": 0,
    • "convertToContractAddress": "string",
    • "recipients":
      [
      ],
    • "memo": "string",
    • "customData":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    submits - a client signed spend request to broadcast - -

    -
    -
    -

    the server will validate the signed requests, co-sign it using the server key and then broadcast to - the network

    -
    -
    -
    -
    path - Parameters
    - - - - - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the account from which the spend request was created

    -
    -
    -
    -
    spendRequestId
    - required
    -
    -
    -
    string - < - uuid - > -
    -
    -
    -

    the id of the spend request

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - -
    spendRequestToken
    - required
    -
    -
    -
    string
    -
    -
    -

    the validation token from the original request

    -
    -
    -
    -
    signedTxHex
    required -
    -
    -
    -
    string
    -
    -
    -

    the client signed transaction encoded in hex

    -
    -
    -
    -
    otp
    required
    -
    -
    -
    string
    -
    -
    -

    2fa token

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/{id}/spend/{spendRequestId}/broadcast - -
    -
    -
    -
    -
    -
    /api/v1/accounts/{id}/spend/{spendRequestId}/broadcast -
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "spendRequestToken": "string",
    • "signedTxHex": "string",
    • "otp": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to create a new - multisig financial account - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - -
    masterKeyId
    required -
    -
    -
    -
    string
    -
    -
    -

    the id of the master key from which the wallet is to be created from

    -
    -
    -
    -
    currencyId
    required -
    -
    -
    -
    string
    -
    -
    -

    the id of the currency that the account will hold

    -
    -
    -
    -
    label
    required
    -
    -
    -
    string
    -
    -
    -

    the user specified name for the new account

    -
    -
    -
    -
    ownerId -
    -
    string - Nullable -
    -
    -
    -

    optional, owner id of the created wallet. If not specified then defaults to the currently - authenticated user, otherwise it must be the id of an organization the user has access to. -

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/multisig - -
    -
    -
    -
    -
    -
    /api/v1/accounts/multisig
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "masterKeyId": "4174c0b10b271a2db74c",
    • "currencyId": "1235",
    • "label": "My new BTC account",
    • "ownerId": ""
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to create a new - singlesig financial account - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - -
    currencyId
    required -
    -
    -
    -
    string
    -
    -
    -

    the id of the currency that the account will hold

    -
    -
    -
    -
    label
    required
    -
    -
    -
    string
    -
    -
    -

    the user specified name for the new account

    -
    -
    -
    -
    ownerId -
    -
    string - Nullable -
    -
    -
    -

    optional, owner id of the created wallet. If not specified then defaults to the currently - authenticated user, otherwise it must be the id of an organization the user has access to. -

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/accounts/singlesig - -
    -
    -
    -
    -
    -
    /api/v1/accounts/singlesig
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "currencyId": "1235",
    • "label": "My new BTC account",
    • "ownerId": ""
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Affiliate

    -
    -
    -
    -
    -
    -
    -

    List the channels the affiliate has - created - -

    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - -
    q -
    -
    string
    -
    -
    -
    -
    -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate/channels - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/channels
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Create a new channel - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - -
    name
    required
    -
    -
    -
    string - [ 0 .. 100 ] characters -
    -
    -
    -

    the name of the channel (unique to an affiliate)

    -
    -
    -
    -
    description -
    -
    string - [ 0 .. 300 ] characters - - Nullable -
    -
    -
    -

    the description of the channel

    -
    -
    -
    -
    earningsType
    required -
    -
    -
    -
    string
    -
    -
    -

    determines how the affiliate will be earning commissions through this channel

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/affiliate/channels - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/channels
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "name": "string",
    • "description": "string",
    • "earningsType": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Finds a channel - by its id - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate/channels/{id} - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/channels/{id}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Updates the details of a - channel - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - -
    name -
    -
    string - [ 0 .. 100 ] characters - - Nullable -
    -
    -
    -

    the name of the channel

    -
    -
    -
    -
    description -
    -
    string - [ 0 .. 300 ] characters - - Nullable -
    -
    -
    -

    the description of the channel

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/affiliate/channels/{id} - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/channels/{id}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "name": "string",
    • "description": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Gets the affiliate information - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate - -
    -
    -
    -
    -
    -
    /api/v1/affiliate
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Gets the commission fee structure that - the affiliate can earn on the CoinPayments platform - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate/fees - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/fees
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    List the earnings of the affiliate, - optionally filtered by a channel and time range - -

    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - -
    channelId -
    -
    string
    -
    -
    -
    -
    -
    from -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    to -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate/earnings - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/earnings
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Get a summary of earnings - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate/earnings/summary - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/earnings/summary
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    List the impressions and - conversions by day for the affiliate, optionally filtered by a channel and time period - -

    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - -
    channelId -
    -
    string
    -
    -
    -
    -
    -
    from -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    to -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate/impressions/daily - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/impressions/daily
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    List the impressions - and conversions by country for the affiliate, optionally filtered by a channel and time period - -

    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - -
    channelId -
    -
    string
    -
    -
    -
    -
    -
    from -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    to -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate/impressions/country - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/impressions/country
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    List the total impressions, - optionally filtered by a channel and time period - -

    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - -
    channelId -
    -
    string
    -
    -
    -
    -
    -
    from -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    to -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/affiliate/impressions - -
    -
    -
    -
    -
    -
    /api/v1/affiliate/impressions
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Currencies

    -
    -
    -
    -
    -
    -
    -

    lists platform supported currencies and - their capabilities. - -

    -
    -
    -

    Returns a page of the supported currencies on the CoinPayments.net platform, by default ordered by - their rank on CoinPayments.net.

    -
    -
    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - - - - - - - - - -
    q -
    -
    string
    -
    -
    -

    optional search query to find currencies with names and/or codes similar to the - specified search string

    -
    -
    -
    -
    types -
    -
    Array of strings - ( - CurrencyType - )
    -
    Items - - Enum - : "crypto" "token" "fiat"
    -
    -
    -

    comma separated list of the types of currencies to return (e.g. 'coin', - 'token', 'fiat', etc.). By default currencies of all types are returned -

    -
    -
    -
    -
    capabilities -
    -
    Array of strings - ( - CurrencyCapability - )
    -
    Items - - Enum - : "multiSigAccounts" "sharedAccounts" "payments" "singleSigAccounts"
    -
    -
    -

    comma separated list of capabilities, currencies without the specified capabilities - won't be returned

    -
    -
    -
    -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/currencies - -
    -
    -
    -
    -
    -
    /api/v1/currencies
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    finds a currency by its id - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    integer - < - int32 - > -
    -
    -
    -

    the id of the currency to retrieve

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/currencies/{id} - -
    -
    -
    -
    -
    -
    /api/v1/currencies/{id}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    gets a list of all possible - currency conversions - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/currencies/conversions - -
    -
    -
    -
    -
    -
    /api/v1/currencies/conversions
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Invoices

    -
    -
    -
    -
    -
    -
    -

    Creates a new invoice - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    clientId
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the client creating this invoice

    -
    -
    -
    -
    currencyId -
    -
    integer - < - int32 - > - - Nullable -
    -
    -
    -

    the id of the currency the invoice is to be in, alternatively this can be set - individually per field

    -
    -
    -
    -
    invoiceId -
    -
    string - [ 0 .. 127 ] characters - - Nullable -
    -
    -
    -

    the optional API caller provided external invoice number. Appears in screens shown to the - Buyer and emails sent.

    -
    -
    -
    -
    buyer - - -
    -
    object - Nullable -
    -
    -
    -

    the buyer information, if not provided it can be requested during payment if needed

    -
    -
    -
    -
    description -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    the purchase description, can be provided instead of a list of items

    -
    -
    -
    -
    items - - -
    -
    Array of objects ( - LineItemDto - ) - Nullable -
    -
    -
    -

    the optional array of items that a buyer intends to purchase from the merchant

    -
    -
    -
    -
    amount - - -
    required
    -
    -
    -
    object
    -
    -
    -

    the total amount of the invoice, with an optional breakdown that provides details, such - as the total item - amount, total tax amount, shipping, handling, insurance and discounts, if any

    -
    -
    -
    -
    shipping - - -
    -
    object - Nullable -
    -
    -
    -

    the optional shipping method and address

    -
    -
    -
    -
    requireBuyerNameAndEmail -
    -
    boolean
    -
    -
    -

    flag indicating whether a buyer name and email are required, they will be requested at - checkout - if not provider by the caller. The - Orion.Api.Models.Merchant.CreateInvoiceRequestDto.BuyerDataCollectionMessage will be - displayed - to the buyer when prompted.

    -
    -
    -
    -
    buyerDataCollectionMessage -
    -
    string - [ 0 .. 300 ] characters - - Nullable -
    -
    -
    -

    the message to display when collecting buyer user data

    -
    -
    -
    -
    notesToRecipient -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    any additional information to share with the buyer about the transaction

    -
    -
    -
    -
    termsAndConditions -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    any terms and conditions, e.g. a cancellation policy

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    any custom data the caller wishes to attach to the invoice which will be sent back in - notifications

    -
    -
    -
    -
    metadata - - -
    -
    object - Nullable -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/invoices - -
    -
    -
    -
    -
    -
    /api/v1/invoices
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "clientId": "string",
    • "currencyId": 0,
    • "invoiceId": "string",
    • "buyer":
      {
      },
    • "description": "string",
    • "items":
      [
      ],
    • "amount":
      {
      },
    • "shipping":
      {
      },
    • "requireBuyerNameAndEmail": true,
    • "buyerDataCollectionMessage": "string",
    • "notesToRecipient": "string",
    • "termsAndConditions": "string",
    • "customData":
      {
      },
    • "metadata":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Updates the buyer information on an - invoice, if it was requested by the merchant - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - -
    buyer - - -
    -
    object - Nullable -
    -
    -
    -

    the buyer information

    -
    -
    -
    -
    shipping - - -
    -
    object - Nullable -
    -
    -
    -

    the shipping method and address

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/invoices/{id} - -
    -
    -
    -
    -
    -
    /api/v1/invoices/{id}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "buyer":
      {
      },
    • "shipping":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Finds an invoice by its id - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/invoices/{id} - -
    -
    -
    -
    -
    -
    /api/v1/invoices/{id}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    MasterKeys

    -
    -
    -
    -
    -
    -
    -

    find a master - key by its id - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the masterkey to retrieve

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/masterkeys/{id} - -
    -
    -
    -
    -
    -
    /api/v1/masterkeys/{id}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    updates a master key label and - encrypted client private key - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the masterkey to update

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - -
    encryptedPrivateKey -
    -
    string - Nullable -
    -
    -
    -

    the clients encrypted private key

    -
    -
    -
    -
    label -
    -
    string - Nullable -
    -
    -
    -

    optional label to apply to the master key

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/masterkeys/{id} - -
    -
    -
    -
    -
    -
    /api/v1/masterkeys/{id}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "encryptedPrivateKey": "string",
    • "label": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    lists all the activated master keys the - user has created - -

    -
    -
    -

    the master keys can be used to create crypto wallets

    -
    -
    -
    -
    query - Parameters
    - - - - - - - - - - - -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/masterkeys - -
    -
    -
    -
    -
    -
    /api/v1/masterkeys
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to create a new MasterKey - -

    -
    -
    -

    the new master key must be activated before wallets can be created

    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - -
    publicKey
    required -
    -
    -
    -
    string
    -
    -
    -

    the clients public key

    -
    -
    -
    -
    encryptedPrivateKey
    - required
    -
    -
    -
    string
    -
    -
    -

    the clients encrypted private key

    -
    -
    -
    -
    label -
    -
    string - Nullable -
    -
    -
    -

    optional label to apply to the master key

    -
    -
    -
    -
    originalPasscodeEncryptionCode
    required
    -
    -
    -
    string - [ 8 .. 40 ] characters -
    -
    -
    -

    the encryption code that was used to encrypt the original passcode on the printed PDF - the user downloaded. Saved by the server in case the user needs to recover it.

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/masterkeys - -
    -
    -
    -
    -
    -
    /api/v1/masterkeys
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "publicKey": "string",
    • "encryptedPrivateKey": "string",
    • "label": "string",
    • "originalPasscodeEncryptionCode": "stringst"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Activates a master key - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the masterkey to activate

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - -
    activationCode
    required -
    -
    -
    -
    string - 6 characters -
    -
    -
    -

    the activation code found on the Backup PDF

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/masterkeys/{id}/activate - -
    -
    -
    -
    -
    -
    /api/v1/masterkeys/{id}/activate
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "activationCode": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Merchant

    -
    -
    -
    -
    -
    -
    -

    Creates a merchant profile for a user or - organization - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -
    -
    string - Nullable -
    -
    -
    -

    the business name of the merchant

    -
    -
    -
    -
    uboName -
    -
    string - Nullable -
    -
    -
    -

    full name of the Ultimate Beneficiary Owner (UBO) of the business

    -
    -
    -
    -
    country -
    -
    string - Nullable -
    -
    -
    -

    the merchant's business country of registration

    -
    -
    -
    -
    websiteUrl -
    -
    string - < - uri - > - - Nullable -
    -
    -
    -

    the url to the merchants website

    -
    -
    -
    -
    address -
    -
    string - [ 0 .. 1000 ] characters - - Nullable -
    -
    -
    -

    the merchant's business address

    -
    -
    -
    -
    email -
    -
    string - Nullable -
    -
    -
    -

    the merchant's business email

    -
    -
    -
    -
    phone -
    -
    string - Nullable -
    -
    -
    -

    the phone number of the business

    -
    -
    -
    -
    description -
    -
    string - Nullable -
    -
    -
    -

    the description of the merchant

    -
    -
    -
    -
    registrationNumber -
    -
    string - Nullable -
    -
    -
    -

    the business registration number

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant - -
    -
    -
    -
    -
    -
    /api/v1/merchant
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "name": "string",
    • "uboName": "string",
    • "country": "string",
    • "websiteUrl": "http://example.com",
    • "address": "string",
    • "email": "string",
    • "phone": "string",
    • "description": "string",
    • "registrationNumber": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Get the profile of the current - merchant - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/profile - -
    -
    -
    -
    -
    -
    /api/v1/merchant/profile
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Updates the profile of the current - merchant - -

    -
    Request Body schema: -
    -
    -

    The fields to update

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -
    -
    string - Nullable -
    -
    -
    -

    the business name of the merchant

    -
    -
    -
    -
    uboName -
    -
    string - Nullable -
    -
    -
    -

    full name of the Ultimate Beneficiary Owner (UBO) of the business

    -
    -
    -
    -
    country -
    -
    string - Nullable -
    -
    -
    -

    the merchant's business country of registration

    -
    -
    -
    -
    websiteUrl -
    -
    string - Nullable -
    -
    -
    -

    the url to the merchants website

    -
    -
    -
    -
    address -
    -
    string - [ 0 .. 1000 ] characters - - Nullable -
    -
    -
    -

    the merchant's business address

    -
    -
    -
    -
    email -
    -
    string - Nullable -
    -
    -
    -

    the merchant's business email

    -
    -
    -
    -
    phone -
    -
    string - Nullable -
    -
    -
    -

    the phone number of the business

    -
    -
    -
    -
    description -
    -
    string - Nullable -
    -
    -
    -

    the description of the merchant

    -
    -
    -
    -
    registrationNumber -
    -
    string - Nullable -
    -
    -
    -

    the business registration number

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    204 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    - - 404 - -

    Not Found

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/merchant/profile - -
    -
    -
    -
    -
    -
    /api/v1/merchant/profile
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "name": "string",
    • "uboName": "string",
    • "country": "string",
    • "websiteUrl": "string",
    • "address": "string",
    • "email": "string",
    • "phone": "string",
    • "description": "string",
    • "registrationNumber": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Gets the merchant's currently - accepted currencies. - Currencies that are ranked (ordered) will be returned at the top of the list. - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/currencies - -
    -
    -
    -
    -
    -
    /api/v1/merchant/currencies
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Adds a currency that a - merchant wishes to receive as payments from Buyers - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    The currency to add

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    -

    The payout configs for the currency

    -
    - - - - - - - - - - - - - - - - - - - -
    frequency -
    -
    string - Nullable -
    -
    - Enum - : "normal" "asSoonAsPossible" "hourly" "nightly" "weekly"
    -
    -
    -

    the frequency of payments into merchant wallets for the current payment currency

    -
    -
    -
    -
    discountPercent -
    -
    number - < - float - > - - [ 0 .. 99.99 ] - - Nullable -
    -
    -
    -

    the discount to give buyers when paying in this currency, maybe as a promotional tool

    -
    -
    -
    -
    markupPercent -
    -
    number - < - float - > - - [ 0 .. 999999999 ] - - Nullable -
    -
    -
    -

    the markup to charge buyers when paying in this currency, maybe to cover local - crypto/fiat conversion costs

    -
    -
    -
    -
    payouts - - -
    -
    Array of objects ( - PayoutConfigDto - ) - Nullable -
    -
    -
    -

    the configurations defining how the merchant would like to receive funds from the current - payment currency

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/currencies/{id} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/currencies/{id}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "frequency": "normal",
    • "discountPercent": 0,
    • "markupPercent": 0,
    • "payouts":
      [
      ]
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Updates a currency that a - merchant wishes to receive as payments from Buyers - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    The currency to add

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - -
    frequency -
    -
    string - Nullable -
    -
    - Enum - : "normal" "asSoonAsPossible" "hourly" "nightly" "weekly"
    -
    -
    -

    the frequency of payments into merchant wallets for the current payment currency

    -
    -
    -
    -
    discountPercent -
    -
    number - < - float - > - - [ 0 .. 99.99 ] - - Nullable -
    -
    -
    -

    the discount to give buyers when paying in this currency, maybe as a promotional tool

    -
    -
    -
    -
    markupPercent -
    -
    number - < - float - > - - [ 0 .. 999999999 ] - - Nullable -
    -
    -
    -

    the markup to charge buyers when paying in this currency, maybe to cover local - crypto/fiat conversion costs

    -
    -
    -
    -
    payouts - - -
    -
    Array of objects ( - PayoutConfigDto - ) - Nullable -
    -
    -
    -

    the configurations defining how the merchant would like to receive funds from the current - payment currency

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/merchant/currencies/{id} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/currencies/{id}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "frequency": "normal",
    • "discountPercent": 0,
    • "markupPercent": 0,
    • "payouts":
      [
      ]
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Deletes a currency that a - merchant no longer wishes to accept - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    The id of the currency to delete

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - delete /api/v1/merchant/currencies/{id} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/currencies/{id}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Update the order - (ranking) of an accepted coin. Will update the rest of the payment currencies so that they can be - returned in the correct order. - To unassign the rank for a currency, pass in 0 for the order. - -

    -
    -
    -

    Example: - A merchant has coins in this rank:

    -
      -
    1. Bitcoin
    2. -
    3. Litecoin
    4. -
    5. Ethereum
    6. -
    -

    Scenario 1: Merchant would like to update Ethereum to rank 1. The new ranks will be:

    -
      -
    1. Ethereum
    2. -
    3. Bitcoin
    4. -
    5. Litecoin
    6. -
    -

    Scenario 2: Merchant would like to unassign the rank for Bitcoin. The new ranks will be:

    -
      -
    1. Litecoin
    2. -
    3. Ethereum
    4. -
    5. Bitcoin
    6. -
    -
    -
    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    The id of the currency

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    -

    the order for the currency

    -
    - - - - - - - -
    order
    required
    -
    -
    -
    integer - < - int32 - > -
    -
    -
    -

    The order (preferred rank) of a payment currency. The smaller the number, the more the - currency is preferred for payment. - To unassign the rank of a payment currency (ie, currency is still accepted but no longer - preferred), pass in a 0 for the Order.

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/merchant/currencies/{id}/order - -
    -
    -
    -
    -
    -
    /api/v1/merchant/currencies/{id}/order
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "order": 0
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Uploads a merchant logo - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/logo - -
    -
    -
    -
    -
    -
    /api/v1/merchant/logo
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Delete a merchant logo - -

    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - delete /api/v1/merchant/logo - -
    -
    -
    -
    -
    -
    /api/v1/merchant/logo
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    MerchantCallbacks -

    -
    -
    -
    -
    -
    -
    -

    Creates a new callback - address - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - -
    clientId -
    -
    string - Nullable -
    -
    -
    -
    -
    -
    currencyId
    required -
    -
    -
    -
    integer - < - int32 - > -
    -
    -
    -

    the id of the currency the address will be receiving

    -
    -
    -
    -
    label -
    -
    string - [ 0 .. 100 ] characters - - Nullable -
    -
    -
    -

    the label of the address (display only)

    -
    -
    -
    -
    webhook - - -
    -
    object - Nullable -
    -
    -
    -

    the webhook notification information and customizations

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/callbacks - -
    -
    -
    -
    -
    -
    /api/v1/merchant/callbacks
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "clientId": "string",
    • "currencyId": 0,
    • "label": "string",
    • "webhook":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    list all callback addresses - sorted descending by the creation date - -

    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - - - - - -
    clientId -
    -
    string
    -
    -
    -
    -
    -
    currencyId -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/callbacks - -
    -
    -
    -
    -
    -
    /api/v1/merchant/callbacks
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    find a - callback address by id - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the callback address

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/callbacks/{id} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/callbacks/{id}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    updates a callback - address - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -

    the id of the callback address

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    -

    the callback address data to update

    -
    - - - - - - - - - - - -
    label -
    -
    string - [ 0 .. 100 ] characters - - Nullable -
    -
    -
    -

    the label of the address (display only)

    -
    -
    -
    -
    webhook - - -
    -
    object - Nullable -
    -
    -
    -

    the webhook notification information and customizations

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/merchant/callbacks/{id} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/callbacks/{id}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "label": "string",
    • "webhook":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    list all deposit - transactions to callback addresses, ordered newest first and optionally filtering by address, - currency and date range - -

    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    callbackId -
    -
    string
    -
    -
    -
    -
    -
    currencyId -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    from -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    to -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/callbacks/deposits - -
    -
    -
    -
    -
    -
    /api/v1/merchant/callbacks/deposits
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    MerchantClients -

    -
    -
    -
    -
    -
    -
    -

    Get all clients belonging to - the merchant - -

    -
    -
    query - Parameters
    - - - - - - - - - - - -
    search -
    -
    string
    -
    -
    -

    The string to search for in the client name

    -
    -
    -
    -
    state -
    -
    string ( - MerchantClientPublicState - )
    -
    - Enum - : "active" "disabled"
    -
    -
    -

    The state of the client (active or disabled)

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/clients - -
    -
    -
    -
    -
    -
    /api/v1/merchant/clients
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Create a new client belonging - to the merchant - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - -
    integration -
    -
    string - [ 1 .. 100 ] characters - - Nullable -
    -
    -
    -

    the name of the integration for which this client was created (e.g. 'Magento', or - 'Shopify')

    -
    -
    -
    -
    name
    required
    -
    -
    -
    string - [ 1 .. 200 ] characters -
    -
    -
    -

    the name of the client that the merchant should provide

    -
    -
    -
    -
    storeUrl
    required
    -
    -
    -
    string - < - uri - > -
    -
    -
    -

    the store url of the client

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/clients - -
    -
    -
    -
    -
    -
    /api/v1/merchant/clients
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Find a - client by its clientId - -

    -
    -
    path - Parameters
    - - - - - - - -
    clientId
    required -
    -
    -
    -
    string
    -
    -
    -

    the id of the client

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/clients/{clientId} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/clients/{clientId}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Update an existing - client belonging to the merchant - -

    -
    -
    path - Parameters
    - - - - - - - -
    clientId
    required -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - -
    name -
    -
    string - Nullable -
    -
    -
    -

    The name of the client provided by the merchant

    -
    -
    -
    -
    storeUrl -
    -
    string - Nullable -
    -
    -
    -

    the store url of the client

    -
    -
    -
    -
    state -
    -
    string - Nullable -
    -
    - Enum - : "active" "disabled"
    -
    -
    -

    The state of the client to update to

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/merchant/clients/{clientId} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/clients/{clientId}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "name": "string",
    • "storeUrl": "string",
    • "state": "active"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Delete an - existing client - -

    -
    -
    path - Parameters
    - - - - - - - -
    clientId
    required -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - delete /api/v1/merchant/clients/{clientId} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/clients/{clientId}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Regenerates - the clients secret, the old secret will no longer be valid for communicating with the API - -

    -
    -
    path - Parameters
    - - - - - - - -
    clientId
    required -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/clients/{clientId}/secret - -
    -
    -
    -
    -
    -
    /api/v1/merchant/clients/{clientId}/secret
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    List all of the webhooks for a particular client - -

    -
    -
    path - Parameters
    - - - - - - - -
    clientId
    required -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -
    query - Parameters
    - - - - - - - -
    type -
    -
    string ( - MerchantClientWebhookNotification - )
    -
    - Enum - : "invoiceCreated" "invoicePending" "invoicePaid" "invoiceCompleted" "invoiceCancelled"
    -
    -
    -

    The notification types for a webhook

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/clients/{clientId}/webhooks - -
    -
    -
    -
    -
    -
    /api/v1/merchant/clients/{clientId}/webhooks
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Create a - new webhook for a client - -

    -
    -
    path - Parameters
    - - - - - - - -
    clientId
    required -
    -
    -
    -
    string
    -
    -
    -

    The public ID of a client

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - -
    notificationsUrl
    - required
    -
    -
    -
    string - < - uri - > -
    -
    -
    -

    the url to which to POST webhook notifications to

    -
    -
    -
    -
    notifications
    required -
    -
    -
    -
    Array of strings ( - MerchantClientWebhookNotification - )
    -
    Items - - Enum - : "invoiceCreated" - "invoicePending" "invoicePaid" "invoiceCompleted" "invoiceCancelled"
    -
    -
    -

    the types of notifications to send to this endpoint

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/clients/{clientId}/webhooks - -
    -
    -
    -
    -
    -
    /api/v1/merchant/clients/{clientId}/webhooks
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Update - an existing webhook for a client - -

    -
    -
    path - Parameters
    - - - - - - - - - - - -
    clientId
    required -
    -
    -
    -
    string
    -
    -
    -

    The public ID of a client

    -
    -
    -
    -
    webhookId
    required -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - -
    notificationsUrl -
    -
    string - < - uri - > - - Nullable -
    -
    -
    -

    the url to which to POST webhook notifications to

    -
    -
    -
    -
    notifications -
    -
    Array of strings ( - MerchantClientWebhookNotification - ) - Nullable -
    -
    Items - - Enum - : "invoiceCreated" - "invoicePending" "invoicePaid" "invoiceCompleted" "invoiceCancelled"
    -
    -
    -

    the types of notifications to send to this endpoint

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/merchant/clients/{clientId}/webhooks/{webhookId} - -
    -
    -
    -
    -
    -
    - /api/v1/merchant/clients/{clientId}/webhooks/{webhookId}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Delete - a webhook for a client - -

    -
    -
    path - Parameters
    - - - - - - - - - - - -
    clientId
    required -
    -
    -
    -
    string
    -
    -
    -

    the public ID of a client

    -
    -
    -
    -
    webhookId
    required -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - delete /api/v1/merchant/clients/{clientId}/webhooks/{webhookId} - -
    -
    -
    -
    -
    -
    - /api/v1/merchant/clients/{clientId}/webhooks/{webhookId}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    MerchantInvoices -

    -
    -
    -
    -
    -
    -
    -

    Creates - payment button code for the specified invoice - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    successUrl
    required -
    -
    -
    -
    string
    -
    -
    -

    the url to redirect to once an invoice is successfully paid

    -
    -
    -
    -
    cancelUrl
    required -
    -
    -
    -
    string
    -
    -
    -

    the url to redirect to if payment of an invoice fails (e.g. expired) or is cancelled by - the user

    -
    -
    -
    -
    ipnUrl -
    -
    string - Nullable -
    -
    -
    -

    the url to send a payment complete message to once the invoice has been paid

    -
    -
    -
    -
    emailNotifications -
    -
    boolean
    -
    -
    -

    flag indicating whether to send an email notification once payment completes successfully -

    -
    -
    -
    -
    buttonWidth -
    -
    integer - < - int32 - > - - Nullable -
    -
    -
    -

    the desired width of the "Buy Now" button

    -
    -
    -
    -
    buttonStyle -
    -
    string - Nullable -
    -
    -
    -

    the style of the button

    -
    -
    -
    -
    isEmailDelivery -
    -
    boolean
    -
    -
    -

    indicates if invoice will be email delivered

    -
    -
    -
    -
    emailDelivery - - -
    -
    object - Nullable -
    -
    -
    -

    the invoice email delivery options if the invoice is to be emailed

    -
    -
    -
    -
    dueDate -
    -
    string - < - date-time - > - - Nullable -
    -
    -
    -

    optional due date to be shown on the invoice

    -
    -
    -
    -
    invoiceDate -
    -
    string - < - date-time - > - - Nullable -
    -
    -
    -

    optional custom invoice date if not the created date of the invoice, invoices with a - future date will - be scheduled

    -
    -
    -
    -
    draft -
    -
    boolean - Nullable -
    -
    -
    -

    flag indicating whether this is a draft invoice

    -
    -
    -
    -
    clientId -
    -
    string - Nullable -
    -
    -
    -

    the id of the client creating this invoice (optional)

    -
    -
    -
    -
    invoiceId -
    -
    string - [ 0 .. 127 ] characters - - Nullable -
    -
    -
    -

    the optional API caller provided external invoice number. Appears in screens shown to the - Buyer and emails sent.

    -
    -
    -
    -
    buyer - - -
    -
    object - Nullable -
    -
    -
    -

    the buyer information, if not provided it can be requested during payment if needed

    -
    -
    -
    -
    description -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    the purchase description, can be provided instead of a list of items

    -
    -
    -
    -
    items - - -
    -
    Array of objects ( - MerchantInvoiceLineItemDto - ) - Nullable -
    -
    -
    -

    the optional array of items that a buyer intends to purchase from the merchant

    -
    -
    -
    -
    amount - - -
    -
    object - Nullable -
    -
    -
    -

    the total amount of the invoice, with an optional breakdown that provides details, such - as the total item - amount, total tax amount, shipping, handling, insurance and discounts, if any

    -
    -
    -
    -
    shipping - - -
    -
    object - Nullable -
    -
    -
    -

    the optional shipping method and address

    -
    -
    -
    -
    requireBuyerNameAndEmail -
    -
    boolean - Nullable -
    -
    -
    -

    flag indicating whether a buyer name and email are required, they will be requested at - checkout - if not provider by the caller. The - Orion.Api.Models.Merchant.CreateMerchantInvoiceRequestDto.BuyerDataCollectionMessage will - be displayed - to the buyer when prompted.

    -
    -
    -
    -
    buyerDataCollectionMessage -
    -
    string - [ 0 .. 300 ] characters - - Nullable -
    -
    -
    -

    the message to display when collecting buyer user data

    -
    -
    -
    -
    notes -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    notes for the merchant only, these are not visible to the buyers

    -
    -
    -
    -
    notesToRecipient -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    any additional information to share with the buyer about the transaction

    -
    -
    -
    -
    termsAndConditions -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    any terms and conditions, e.g. a cancellation policy

    -
    -
    -
    -
    merchantOptions - - -
    -
    object - Nullable -
    -
    -
    -

    options to show/hide merchant information on an invoice, or include additional merchant - information specific to an invoice

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    any custom data the caller wishes to attach to the invoice which will be sent back in - notifications

    -
    -
    -
    -
    metadata - - -
    -
    object - Nullable -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/invoices/buy-now-button - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices/buy-now-button
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "successUrl": "string",
    • "cancelUrl": "string",
    • "ipnUrl": "string",
    • "emailNotifications": true,
    • "buttonWidth": 0,
    • "buttonStyle": "string",
    • "isEmailDelivery": true,
    • "emailDelivery":
      {
      },
    • "dueDate": "2020-08-28T10:08:25Z",
    • "invoiceDate": "2020-08-28T10:08:25Z",
    • "draft": true,
    • "clientId": "string",
    • "invoiceId": "string",
    • "buyer":
      {
      },
    • "description": "string",
    • "items":
      [
      ],
    • "amount":
      {
      },
    • "shipping":
      {
      },
    • "requireBuyerNameAndEmail": true,
    • "buyerDataCollectionMessage": "string",
    • "notes": "string",
    • "notesToRecipient": "string",
    • "termsAndConditions": "string",
    • "merchantOptions":
      {
      },
    • "customData":
      {
      },
    • "metadata":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Generates the next - invoice number - -

    -
    Request Body schema: -
    -
    - - - - - - - -
    invoiceId -
    -
    string - Nullable -
    -
    -
    -

    Merchant invoice id, if not unique will be appended with auto-incrementing numbers, - otherwise - if unique will be used directly

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/invoices/nextid - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices/nextid
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "invoiceId": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Get a list of the current - merchant's invoices. - -

    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    clientId -
    -
    string
    -
    -
    -

    optional query to filter the invoices by pending, completed, or expired status

    -
    -
    -
    -
    status -
    -
    string ( - InvoiceStatus - )
    -
    - Enum - : "draft" "scheduled" "unpaid" "pending" "paid" "completed" "cancelled" "timedOut"
    -
    -
    -

    optional query to fetch invoices that were created with the specific client

    -
    -
    -
    -
    from -
    -
    string - < - date-time - > -
    -
    -
    -

    optional query to fetch from and including the time specified up to the current time -

    -
    -
    -
    -
    to -
    -
    string - < - date-time - > -
    -
    -
    -

    optional query to fetch all invoices up to and including the specified time

    -
    -
    -
    -
    q -
    -
    string
    -
    -
    -

    optional search string to find invoices with these words

    -
    -
    -
    -
    integration -
    -
    string
    -
    -
    -

    optional integration by which the invoice was created

    -
    -
    -
    -
    payoutWalletId -
    -
    string
    -
    -
    -

    optional query to filter the invoices by the wallet they were paid out to (for - 'paid' and 'completed' invoices)

    -
    -
    -
    -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/invoices - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Creates a new invoice - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    isEmailDelivery -
    -
    boolean
    -
    -
    -

    indicates if invoice will be email delivered

    -
    -
    -
    -
    emailDelivery - - -
    -
    object - Nullable -
    -
    -
    -

    the invoice email delivery options if the invoice is to be emailed

    -
    -
    -
    -
    dueDate -
    -
    string - < - date-time - > - - Nullable -
    -
    -
    -

    optional due date to be shown on the invoice

    -
    -
    -
    -
    invoiceDate -
    -
    string - < - date-time - > - - Nullable -
    -
    -
    -

    optional custom invoice date if not the created date of the invoice, invoices with a - future date will - be scheduled

    -
    -
    -
    -
    draft -
    -
    boolean - Nullable -
    -
    -
    -

    flag indicating whether this is a draft invoice

    -
    -
    -
    -
    clientId -
    -
    string - Nullable -
    -
    -
    -

    the id of the client creating this invoice (optional)

    -
    -
    -
    -
    invoiceId -
    -
    string - [ 0 .. 127 ] characters - - Nullable -
    -
    -
    -

    the optional API caller provided external invoice number. Appears in screens shown to the - Buyer and emails sent.

    -
    -
    -
    -
    buyer - - -
    -
    object - Nullable -
    -
    -
    -

    the buyer information, if not provided it can be requested during payment if needed

    -
    -
    -
    -
    description -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    the purchase description, can be provided instead of a list of items

    -
    -
    -
    -
    items - - -
    -
    Array of objects ( - MerchantInvoiceLineItemDto - ) - Nullable -
    -
    -
    -

    the optional array of items that a buyer intends to purchase from the merchant

    -
    -
    -
    -
    amount - - -
    -
    object - Nullable -
    -
    -
    -

    the total amount of the invoice, with an optional breakdown that provides details, such - as the total item - amount, total tax amount, shipping, handling, insurance and discounts, if any

    -
    -
    -
    -
    shipping - - -
    -
    object - Nullable -
    -
    -
    -

    the optional shipping method and address

    -
    -
    -
    -
    requireBuyerNameAndEmail -
    -
    boolean - Nullable -
    -
    -
    -

    flag indicating whether a buyer name and email are required, they will be requested at - checkout - if not provider by the caller. The - Orion.Api.Models.Merchant.CreateMerchantInvoiceRequestDto.BuyerDataCollectionMessage will - be displayed - to the buyer when prompted.

    -
    -
    -
    -
    buyerDataCollectionMessage -
    -
    string - [ 0 .. 300 ] characters - - Nullable -
    -
    -
    -

    the message to display when collecting buyer user data

    -
    -
    -
    -
    notes -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    notes for the merchant only, these are not visible to the buyers

    -
    -
    -
    -
    notesToRecipient -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    any additional information to share with the buyer about the transaction

    -
    -
    -
    -
    termsAndConditions -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    any terms and conditions, e.g. a cancellation policy

    -
    -
    -
    -
    merchantOptions - - -
    -
    object - Nullable -
    -
    -
    -

    options to show/hide merchant information on an invoice, or include additional merchant - information specific to an invoice

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    any custom data the caller wishes to attach to the invoice which will be sent back in - notifications

    -
    -
    -
    -
    metadata - - -
    -
    object - Nullable -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/invoices - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "isEmailDelivery": true,
    • "emailDelivery":
      {
      },
    • "dueDate": "2020-08-28T10:08:26Z",
    • "invoiceDate": "2020-08-28T10:08:26Z",
    • "draft": true,
    • "clientId": "string",
    • "invoiceId": "string",
    • "buyer":
      {
      },
    • "description": "string",
    • "items":
      [
      ],
    • "amount":
      {
      },
    • "shipping":
      {
      },
    • "requireBuyerNameAndEmail": true,
    • "buyerDataCollectionMessage": "string",
    • "notes": "string",
    • "notesToRecipient": "string",
    • "termsAndConditions": "string",
    • "merchantOptions":
      {
      },
    • "customData":
      {
      },
    • "metadata":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Find - invoice belonging to merchant by the invoice ID - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/invoices/{id} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices/{id}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Updates an existing - invoice in draft state - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    isEmailDelivery -
    -
    boolean
    -
    -
    -

    indicates if invoice will be email delivered

    -
    -
    -
    -
    emailDelivery - - -
    -
    object - Nullable -
    -
    -
    -

    the invoice email delivery options if the invoice is to be emailed

    -
    -
    -
    -
    dueDate -
    -
    string - < - date-time - > - - Nullable -
    -
    -
    -

    optional due date to be shown on the invoice

    -
    -
    -
    -
    invoiceDate -
    -
    string - < - date-time - > - - Nullable -
    -
    -
    -

    optional custom invoice date if not the created date of the invoice, invoices with a - future date will - be scheduled

    -
    -
    -
    -
    draft -
    -
    boolean - Nullable -
    -
    -
    -

    flag indicating whether this is a draft invoice

    -
    -
    -
    -
    invoiceId -
    -
    string - [ 0 .. 127 ] characters - - Nullable -
    -
    -
    -

    the optional API caller provided external invoice number. Appears in screens shown to the - Buyer and emails sent.

    -
    -
    -
    -
    buyer - - -
    -
    object - Nullable -
    -
    -
    -

    the buyer information, if not provided it can be requested during payment if needed

    -
    -
    -
    -
    description -
    -
    string - [ 0 .. 200 ] characters - - Nullable -
    -
    -
    -

    the purchase description, can be provided instead of a list of items

    -
    -
    -
    -
    items - - -
    -
    Array of objects ( - MerchantInvoiceLineItemDto - ) - Nullable -
    -
    -
    -

    the optional array of items that a buyer intends to purchase from the merchant

    -
    -
    -
    -
    amount - - -
    -
    object - Nullable -
    -
    -
    -

    the total amount of the invoice, with an optional breakdown that provides details, such - as the total item - amount, total tax amount, shipping, handling, insurance and discounts, if any

    -
    -
    -
    -
    shipping - - -
    -
    object - Nullable -
    -
    -
    -

    the optional shipping method and address

    -
    -
    -
    -
    requireBuyerNameAndEmail -
    -
    boolean - Nullable -
    -
    -
    -

    flag indicating whether a buyer name and email are required, they will be requested at - checkout - if not provider by the caller. The - Orion.Api.Models.Merchant.UpdateMerchantInvoiceRequestDto.BuyerDataCollectionMessage will - be displayed - to the buyer when prompted.

    -
    -
    -
    -
    buyerDataCollectionMessage -
    -
    string - [ 0 .. 300 ] characters - - Nullable -
    -
    -
    -

    the message to display when collecting buyer user data

    -
    -
    -
    -
    notes -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    notes for the merchant only, these are not visible to the buyers

    -
    -
    -
    -
    notesToRecipient -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    any additional information to share with the buyer about the transaction

    -
    -
    -
    -
    termsAndConditions -
    -
    string - [ 0 .. 500 ] characters - - Nullable -
    -
    -
    -

    any terms and conditions, e.g. a cancellation policy

    -
    -
    -
    -
    merchantOptions - - -
    -
    object - Nullable -
    -
    -
    -

    options to show/hide merchant information on an invoice, or include additional merchant - information specific to an invoice

    -
    -
    -
    -
    customData - - -
    -
    object - Nullable -
    -
    -
    -

    any custom data the caller wishes to attach to the invoice which will be sent back in - notifications

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/merchant/invoices/{id} - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices/{id}
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "isEmailDelivery": true,
    • "emailDelivery":
      {
      },
    • "dueDate": "2020-08-28T10:08:26Z",
    • "invoiceDate": "2020-08-28T10:08:26Z",
    • "draft": true,
    • "invoiceId": "string",
    • "buyer":
      {
      },
    • "description": "string",
    • "items":
      [
      ],
    • "amount":
      {
      },
    • "shipping":
      {
      },
    • "requireBuyerNameAndEmail": true,
    • "buyerDataCollectionMessage": "string",
    • "notes": "string",
    • "notesToRecipient": "string",
    • "termsAndConditions": "string",
    • "merchantOptions":
      {
      },
    • "customData":
      {
      }
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Lists the - history events of an invoice by the invoice ID - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/invoices/{id}/history - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices/{id}/history
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Cancels an - invoice - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/merchant/invoices/{id}/cancel - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices/{id}/cancel
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Deletes a - draft or scheduled invoice - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - delete /api/v1/merchant/invoices/{id}/delete - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices/{id}/delete
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Get payout - details for an invoice, including if invoice has been fully paid out, the exact amount they will receive - and in what currency, which address payout will be deposited, and who (Buyer) performed the payment. - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/merchant/invoices/{id}/payouts - -
    -
    -
    -
    -
    -
    /api/v1/merchant/invoices/{id}/payouts
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Preferences

    -
    -
    -
    -
    -
    -
    -

    gets the user preferences - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/preferences - -
    -
    -
    -
    -
    -
    /api/v1/preferences
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to update user - preferences - -

    -
    Request Body schema: -
    -
    -

    the preferences to update, each of the body fields is optional and if not specified, or specified as - null, then the current value will be retained

    -
    - - - - - - - - - - - - - - - - - - - -
    nativeCurrencyId -
    -
    string - Nullable -
    -
    -
    -

    the users native currency id, api calls will return monetary amounts in this currency - along with the - original currencies. If not specified then the current preference will not be updated.

    -
    -
    -
    -
    notifyOnFundsReceived -
    -
    boolean - Nullable -
    -
    -
    -

    optional value indicating whether to send the user a notification when funds are received - into one of, - their accounts. If not specified then the current preference will not be updated.

    -
    -
    -
    -
    notifyOnFundsSent -
    -
    boolean - Nullable -
    -
    -
    -

    optional value indicating whether to send the user a notification when funds are sent - from one of their - accounts. If not specified then the current preference will not be updated.

    -
    -
    -
    -
    language -
    -
    string - [ 2 .. 5 ] characters - - Nullable -
    -
    -
    -

    optional language code for the user (e.g. 'EN' or 'EN-US')

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    202 - -

    Accepted

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/preferences - -
    -
    -
    -
    -
    -
    /api/v1/preferences
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "nativeCurrencyId": "1235",
    • "notifyOnFundsReceived": true,
    • "notifyOnFundsSent": true,
    • "language": "strin"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Rates

    -
    -
    -
    -
    -
    -
    -

    lists the current conversion rates between currencies - -

    -
    -
    -

    Returns the currency conversion rates for the specified from currencies converted to - the specified to currencies

    -
    -
    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - - - - - -
    from -
    -
    string
    -
    -
    -

    comma separated list of currency ids to use as the source for rate calculations

    -
    -
    -
    -
    to -
    -
    string
    -
    -
    -

    comma separated list of currency ids for which to retrieve conversion rates for (from - the from currencies)

    -
    -
    -
    -
    fromToken -
    -
    string
    -
    -
    -

    optional, contract address of the token on the from currency

    -
    -
    -
    -
    toToken -
    -
    string
    -
    -
    -

    optional, contract address of the token on the quote currency

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/rates - -
    -
    -
    -
    -
    -
    /api/v1/rates
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Reports

    -
    -
    -
    -
    -
    -
    -

    <no summary> - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - - - - - -
    txTypes -
    -
    Array of integers - < - int32 - > - - Nullable -
    -
    -
    -
    -
    -
    startDate -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    endDate -
    -
    string - < - date-time - > -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/reports - -
    -
    -
    -
    -
    -
    /api/v1/reports
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "txTypes":
      [
      ],
    • "startDate": "2020-08-28T10:08:26Z",
    • "endDate": "2020-08-28T10:08:26Z"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Settings

    -
    -
    -
    -
    -
    -
    -

    <no summary> - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - -
    key
    required
    -
    -
    -
    string - <= 95 characters -
    -
    -
    -
    -
    -
    value
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/settings - -
    -
    -
    -
    -
    -
    /api/v1/settings
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "key": "string",
    • "value": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    <no summary> - -

    -
    Request Body schema: -
    -
    - - - - - - - - - - - -
    key
    required
    -
    -
    -
    string - <= 95 characters -
    -
    -
    -
    -
    -
    value
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/settings - -
    -
    -
    -
    -
    -
    /api/v1/settings
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "key": "string",
    • "value": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    <no summary> - -

    -
    -
    path - Parameters
    - - - - - - - -
    key
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/settings/{key} - -
    -
    -
    -
    -
    -
    /api/v1/settings/{key}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type -
    application/json
    -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "key": "string",
    • "value": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    SharedInvoices

    -
    -
    -
    -
    -
    -
    -

    Finds an - invoice shared by a merchant - -

    -
    -
    path - Parameters
    - - - - - - - -
    sharedInvoiceId
    - required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/shared-invoices/{sharedInvoiceId} - -
    -
    -
    -
    -
    -
    /api/v1/shared-invoices/{sharedInvoiceId}
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    SmartContracts

    -
    -
    -
    -
    -
    -
    -

    Lists the smart - contracts (like ERC20) known to the system - -

    -
    -
    path - Parameters
    - - - - - - - -
    currencyId
    required -
    -
    -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/smartcontracts/{currencyId} - -
    -
    -
    -
    -
    -
    /api/v1/smartcontracts/{currencyId}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Lists - the smart contracts (like ERC20) known to the system - -

    -
    -
    path - Parameters
    - - - - - - - - - - - -
    currencyId
    required -
    -
    -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    contractsAddress
    - required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/smartcontracts/{currencyId}/{contractsAddress} - -
    -
    -
    -
    -
    -
    /api/v1/smartcontracts/{currencyId}/{contractsAddress} -
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    TopUps

    -
    -
    -
    -
    -
    -
    -

    Gets user's top up orders (history) - -

    -
    -
    query - Parameters
    - - - - - - - - - - - -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/topups/orders - -
    -
    -
    -
    -
    -
    /api/v1/topups/orders
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Gets list of providers available to the - user in which to place top up order - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/topups/providers - -
    -
    -
    -
    -
    -
    /api/v1/topups/providers
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Transactions

    -
    -
    -
    -
    -
    -
    -

    lists all the transactions - -

    -
    -
    -

    lists all transactions, sorted by the created date with the most recent first

    -
    -
    -
    -
    query - Parameters
    - - - - - - - - - - - - - - - - - - - - - - - -
    accountId -
    -
    string - < - uuid - > -
    -
    -
    -

    optional, id of the account for which to list transactions for

    -
    -
    -
    -
    from -
    -
    string - < - date-time - > -
    -
    -
    -

    optional, ISO 8601 formatted UTC date from which to list transactions starting from - (e.g. '2019-01-17')

    -
    -
    -
    -
    to -
    -
    string - < - date-time - > -
    -
    -
    -

    optional, ISO 8601 formatted UTC date until which to list transactions (e.g. - '2019-01-27')

    -
    -
    -
    -
    after -
    -
    string
    -
    -
    -
    -
    -
    limit -
    -
    integer - < - int32 - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/transactions - -
    -
    -
    -
    -
    -
    /api/v1/transactions
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    find a transaction by id - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string - < - uuid - > -
    -
    -
    -

    the id of the transaction to retrieve

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/transactions/{id} - -
    -
    -
    -
    -
    -
    /api/v1/transactions/{id}
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    list all the events of a - transaction - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string - < - uuid - > -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/transactions/{id}/events - -
    -
    -
    -
    -
    -
    /api/v1/transactions/{id}/events
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    sends a request to change - the transaction memo - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string - < - uuid - > -
    -
    -
    -

    the id of the transaction to retrieve

    -
    -
    -
    -
    -
    -
    Request Body schema: -
    -
    - - - - - - - -
    memo -
    -
    string - Nullable -
    -
    -
    -

    The new memo for the transaction

    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - put /api/v1/transactions/{id}/memo - -
    -
    -
    -
    -
    -
    /api/v1/transactions/{id}/memo
    -
    -
    -
    -
    -
    -

    Request samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    -
    -
    -
    Copy
    -
    Expand all Collapse all
    -
    -
    -
    {
    • "memo": "string"
    }
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Get currently logged in - user's transacted volume (total value of incoming and outgoing transactions) - and the volume limit set in the system, with option to pass in user's preferred currency - -

    -
    -
    query - Parameters
    - - - - - - - -
    currencyId -
    -
    integer - < - int32 - > -
    -
    -
    -

    The currency the transacted volume and limit should be returned in

    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/transactions/volume - -
    -
    -
    -
    -
    -
    /api/v1/transactions/volume
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    User

    -
    -
    -
    -
    -
    -
    -

    Indicates which features, that are only - available to certain users, are available for this particular user - -

    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/user/features - -
    -
    -
    -
    -
    -
    /api/v1/user/features
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    UserNotifications -

    -
    -
    -
    -
    -
    -
    -

    Get list of active notifications - -

    -
    -
    query - Parameters
    - - - - - - - -
    languageCode -
    -
    string - ^([a-z]|[A-Z]){2}$ -
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    - - 200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - get /api/v1/notifications - -
    -
    -
    -
    -
    -
    /api/v1/notifications
    -
    -
    -
    -
    -
    -

    Response samples

    -
    -
      - -
    -
    -
    -
    Content type - -
    -
    No sample
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Mark a notification - as read - -

    -
    -
    path - Parameters
    - - - - - - - -
    id
    required
    -
    -
    -
    string
    -
    -
    -
    -
    -
    -
    -
    -

    Responses

    -
    -
    200 - -

    Success

    -
    -
    -
    -
    401 - -

    Unauthorized

    -
    -
    -
    -
    403 - -

    Forbidden

    -
    -
    -
    -
    -
    -
    -
    - post /api/v1/notifications/{id}/read - -
    -
    -
    -
    -
    -
    /api/v1/notifications/{id}/read
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - diff --git a/openapi/README.md b/openapi/README.md new file mode 100644 index 0000000..0511b07 --- /dev/null +++ b/openapi/README.md @@ -0,0 +1,13 @@ +## The `openapi` folder + +This folder contains your entrypoint `openapi.yaml`. + +That file contains references to the entire API definition. + +Here are some sections to pay attention to: + +* Top-level **description**: this accepts markdown, and Redoc and Redocly API Reference will render it at the top of the docs. Consider maintaining your markdown in a separate file and [embedding it](https://redocly.com/docs/api-reference-docs/embedded-markdown/). Note to Redoc community edition users, the special tags are only available to the Redocly API Reference users, but you can still embed markdown. +* Security schemes: you will define the scheme(s) your API uses for security (eg OAuth2, API Key, etc...). The security schemes are used by the Redocly API Reference "Try It" API console feature. +* [Paths](paths/README.md): this defines each endpoint. A path can have one operation per http method. +* Tags: it's a good idea to organize each operation. Each tag can have a description. The description is used as a section description within the reference docs. +* Servers: a list of your servers, each with a URL. diff --git a/openapi/code_samples/PHP/echo/post.php b/openapi/code_samples/PHP/echo/post.php new file mode 100644 index 0000000..72da145 --- /dev/null +++ b/openapi/code_samples/PHP/echo/post.php @@ -0,0 +1,7 @@ +$form = new \API\Entities\Echo(); +$form->setMessage("Hello World!"); +try { + $pet = $client->echo()->post($form); +} catch (UnprocessableEntityException $e) { + var_dump($e->getErrors()); +} diff --git a/openapi/code_samples/README.md b/openapi/code_samples/README.md new file mode 100644 index 0000000..c9d27a1 --- /dev/null +++ b/openapi/code_samples/README.md @@ -0,0 +1,11 @@ +Code samples +===== + +This is our recommended convention for organizing `code_samples`: + +[x-codeSamples](https://redocly.com/docs/api-reference-docs/specification-extensions/x-code-samples/) +Path `//.` where: + * `` - name of the language from [this](https://github.com/github/linguist/blob/master/lib/linguist/popular.yml) list. + * `` - path of the target method, where all `/` are replaced with `_`. + * `` - verb of target method. + * `` - ignored. diff --git a/openapi/code_samples/csharp/echo/post.cs b/openapi/code_samples/csharp/echo/post.cs new file mode 100644 index 0000000..a91d094 --- /dev/null +++ b/openapi/code_samples/csharp/echo/post.cs @@ -0,0 +1,12 @@ +API.v1.Echo echo = new API.v1.Echo(); +echo.message = "Hello World!"); +EchoResponse response = echo.post(); +if (response.statusCode == HttpStatusCode.Created) +{ + // Success +} +else +{ + // Something wrong -- check response for errors + Console.WriteLine(response.getRawResponse()); +} diff --git a/openapi/code_samples/nodejs/authenticate/authenticate.js b/openapi/code_samples/nodejs/authenticate/authenticate.js new file mode 100644 index 0000000..51cf164 --- /dev/null +++ b/openapi/code_samples/nodejs/authenticate/authenticate.js @@ -0,0 +1,35 @@ +const url = 'https://orion-api.starhermit.com/api/v1/{YOUR_PATH}'; +const clientId = 'YOUR_CLIENT_ID'; +const clientSecret = 'YOUR_CLIENT_SECRET='; + +const method = 'POST'; +const date = new Date().toISOString().split('.')[0]; + +const requestPayload = { + id: 1, + label: 'test', +} + +const queryString = `\ufeff${method}${url}${clientId}${date}${JSON.stringify(requestPayload)}`; + +/** create signature */ +const key = CryptoJS.enc.Utf8.parse(clientSecret); +const input = CryptoJS.enc.Utf8.parse(queryString); +const hash = CryptoJS.HmacSHA256(input, key); +const signature = CryptoJS.enc.Base64.stringify(hash); + + +const headers = { + 'X-CoinPayments-Client': clientId, + 'X-CoinPayments-Timestamp': date, + 'X-CoinPayments-Signature': signature, +}; + + +const axiosOptions = { + url, + headers, + method, + data: null, +}; +const response = await axios.request(axiosOptions); diff --git a/openapi/components/README.md b/openapi/components/README.md new file mode 100644 index 0000000..e6eb9b2 --- /dev/null +++ b/openapi/components/README.md @@ -0,0 +1,13 @@ +# Reusable components + +* You can create the following folders here: + - `schemas` - reusable [Schema Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) + - `responses` - reusable [Response Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject) + - `parameters` - reusable [Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject) + - `examples` - reusable [Example Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) + - `headers` - reusable [Header Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject) + - `requestBodies` - reusable [Request Body Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#requestBodyObject) + - `links` - reusable [Link Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#linkObject) + - `callbacks` - reusable [Callback Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject) + - `securitySchemes` - reusable [Security Scheme Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject) +* Filename of files inside the folders represent component name, e.g. `Customer.yaml` diff --git a/openapi/components/conversion/convertRequestConfirmation.yaml b/openapi/components/conversion/convertRequestConfirmation.yaml new file mode 100644 index 0000000..6586c13 --- /dev/null +++ b/openapi/components/conversion/convertRequestConfirmation.yaml @@ -0,0 +1,7 @@ +type: object +properties: + convertRequestId: + description: Id of convert request + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + diff --git a/openapi/components/conversion/convertRequestSuccess.yaml b/openapi/components/conversion/convertRequestSuccess.yaml new file mode 100644 index 0000000..870e587 --- /dev/null +++ b/openapi/components/conversion/convertRequestSuccess.yaml @@ -0,0 +1,7 @@ +type: object +properties: + convertRequestId: + description: Id of the convert request + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + diff --git a/openapi/components/conversion/sendConvertRequest.yaml b/openapi/components/conversion/sendConvertRequest.yaml new file mode 100644 index 0000000..7a189bd --- /dev/null +++ b/openapi/components/conversion/sendConvertRequest.yaml @@ -0,0 +1,46 @@ +type: object +required: + - toCurrencyId + - amountInSmallestUnits + - toAddress +properties: + fromContractAddress: + type: string + description: | + The contract address of the source cryptocurrency if it is a token. + It is required only if you are performing a conversion from a specific token. + e.g. "0xdac17f958d2ee523a2206206994597c13d831ec7" for ERC20 TetherUSD + toContractAddress: + type: string + description: | + The contract address of the target cryptocurrency if it is a token. + It is required only if you are converting to a specific token. + e.g. "0xdac17f958d2ee523a2206206994597c13d831ec7" for ERC20 TetherUSD + toAddress: + type: string + description: Address which client wants to send funds to + toCurrencyId: + type: integer + description: ID of the currency of the spend destination + blockchainFeeOverrideInSmallestUnits: + type: number + description: Used for overriding the system suggested blockchain fee (within 10% range) to manage the transaction processing speed + amountInSmallestUnits: + description: | + refers to the amount of a specific cryptocurrency, such as Bitcoin, measured in its smallest divisible unit, AKA atomic units. + (e.g., Satoshis for Bitcoin). + It allows for precise and detailed transactions by specifying the amount in the smallest possible denomination. + This approach enables you to send fractional amounts of the currency accurately. + type: string + example: '9900000' + memo: + type: string + description: optional user-defined note to associate with the spend request + receiverPaysFee: + type: boolean + description: | + When set to true, the receiver of the conversion will pay the fees. In this case, + the AmountInSmallestUnits will be deducted from the source balance, and the receiver will receive the remaining amount after deducting the fees. + When set to false (or not provided), the fees will be added to the AmountInSmallestUnits, + and the total sum (including fees) will be deducted from the source balance. + The receiver will receive the AmountInSmallestUnits exactly as specified. \ No newline at end of file diff --git a/openapi/components/globalTypes/InvoicePayoutConfig.yaml b/openapi/components/globalTypes/InvoicePayoutConfig.yaml new file mode 100644 index 0000000..0bb7ddd --- /dev/null +++ b/openapi/components/globalTypes/InvoicePayoutConfig.yaml @@ -0,0 +1,24 @@ +type: object +properties: + to_currency: + type: integer + description: the currency id of the wallet or address into which to payout to + format: int32 + address: + type: object + description: the external address into which to pay out + properties: + address: + type: 'null' + wallet_id: + type: string + description: wallet into which to payout to if payout is internal + frequency: + type: array + description: frequency with which payout in this currency takes place. Provided as an array of strings. + example: ['normal', + 'asSoonAsPossible', + 'hourly', + 'nightly', + 'weekly' + ] \ No newline at end of file diff --git a/openapi/components/globalTypes/address.yaml b/openapi/components/globalTypes/address.yaml new file mode 100644 index 0000000..3db3dec --- /dev/null +++ b/openapi/components/globalTypes/address.yaml @@ -0,0 +1,2 @@ +type: string +example: 'mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9' diff --git a/openapi/components/globalTypes/amount-v2.yaml b/openapi/components/globalTypes/amount-v2.yaml new file mode 100644 index 0000000..38d72d2 --- /dev/null +++ b/openapi/components/globalTypes/amount-v2.yaml @@ -0,0 +1,15 @@ +type: object +properties: + value: + type: string + description: | + This parameter represents the monetary value as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0. + currencyId: + type: string + description: the currency id of the wallet or address into which to payout to or Id of the native invoice currency + currencySymbol: + type: string + description: the currency symbol of the wallet or address into which to payout to diff --git a/openapi/components/globalTypes/amount.yaml b/openapi/components/globalTypes/amount.yaml new file mode 100644 index 0000000..621b894 --- /dev/null +++ b/openapi/components/globalTypes/amount.yaml @@ -0,0 +1,19 @@ +type: object +properties: + displayValue: + type: string + description: 'The value formatted for display (e.g 0.1234 BTC)' + value: + type: string + description: | + This parameter represents the monetary value as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0. + currencyId: + type: string + description: the currency id of the wallet or address into which to payout to or Id of the native invoice currency + valueAsDecimal: + type: string + description: the decimal value represents the monetary value of the full invoice amount with decimal precision derinvoicePaymentAmountDue.yamlived from the value field, which is the integer representation in the smallest unit of the currency or token + diff --git a/openapi/components/globalTypes/clientId.yaml b/openapi/components/globalTypes/clientId.yaml new file mode 100644 index 0000000..24b10d5 --- /dev/null +++ b/openapi/components/globalTypes/clientId.yaml @@ -0,0 +1,2 @@ +type: string +example: '787741c5d17a4d4298012cedd6aa9671' diff --git a/openapi/components/globalTypes/currency.yaml b/openapi/components/globalTypes/currency.yaml new file mode 100644 index 0000000..4bd00dc --- /dev/null +++ b/openapi/components/globalTypes/currency.yaml @@ -0,0 +1,51 @@ +type: object +description: the currency id of the wallet or address into which to payout to +properties: + id: + type: string + description: id of the cryptocurrency that can be applied for payment + type: + type: array + description: type of the currency that can be applied for payment. Possible values - 'crypto', 'token', 'fiat' + symbol: + type: string + description: currency ticker + name: + type: string + description: name of the currency + logo: + type: string + description: link to the logo of the currency + decimalPlaces: + type: integer + description: number of decimal places to display for the cryptocurrency value + rank: + type: integer + description: rank of the cryptocurrency depending on its reliability on the market + status: + type: string + description: status of the currency in the system. Possible values - 'active', 'underMaintenance', 'deleted' + capabilities: + type: string + description: specific capabilities of the currency. Possible values - 'payments', 'singleSigAccounts', 'pooledAccounts' + urls: + type: object + description: web links pertaining to the cryptocurrency + properties: + websites: + type: array + description: list of links to websites pertaining to the cryptocurrency + explorers: + type: array + description: list of links to explorers pertaining to the cryptocurrency + requiredConfirmations: + type: integer + description: number of confirmations required on chain for the transaction in the cryptocurrency to be considered completed + isEnabledForPayment: + type: boolean + description: a flag indicating that payment is activated for making payment + + + + + diff --git a/openapi/components/globalTypes/currencyId.yaml b/openapi/components/globalTypes/currencyId.yaml new file mode 100644 index 0000000..608add0 --- /dev/null +++ b/openapi/components/globalTypes/currencyId.yaml @@ -0,0 +1,3 @@ +type: string +description: the currency id of the wallet or address into which to payout to +example: '1' diff --git a/openapi/components/globalTypes/datetime.yaml b/openapi/components/globalTypes/datetime.yaml new file mode 100644 index 0000000..e77f7cb --- /dev/null +++ b/openapi/components/globalTypes/datetime.yaml @@ -0,0 +1,3 @@ +type: string +example: '2022-11-29T19:10:04.228Z' + diff --git a/openapi/components/globalTypes/fees.yaml b/openapi/components/globalTypes/fees.yaml new file mode 100644 index 0000000..fabf369 --- /dev/null +++ b/openapi/components/globalTypes/fees.yaml @@ -0,0 +1,17 @@ +type: object +properties: + displayValue: + type: string + description: the value of the fee formatted for display (e.g 0.1234 BTC) + value: + type: string + description: this parameter represents the monetary value of the fee as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0. + currencyId: + type: string + description: the currency Id of the wallet or address into which to payout to or Id of the native invoice currency + valueAsDecimal: + type: string + description: the decimal value represents the monetary value of the full invoice amount with decimal precision derived from the value field, which is the integer representation in the smallest unit of the currency or token diff --git a/openapi/components/globalTypes/fullName.yaml b/openapi/components/globalTypes/fullName.yaml new file mode 100644 index 0000000..bd7f7ae --- /dev/null +++ b/openapi/components/globalTypes/fullName.yaml @@ -0,0 +1,8 @@ +type: object +properties: + firstName: + type: string + description: first name of the buyer + lastName: + type: string + description: last name of the buyer \ No newline at end of file diff --git a/openapi/components/globalTypes/globalAmount.yaml b/openapi/components/globalTypes/globalAmount.yaml new file mode 100644 index 0000000..238477b --- /dev/null +++ b/openapi/components/globalTypes/globalAmount.yaml @@ -0,0 +1,22 @@ +type: object +required: + - currencyId + - value +properties: + currencyId: + type: string + description: the currency id of the wallet or address into which to payout to. Currency ids can be checked via Currencies API + displayValue: + type: string + description: the value formatted for display (e.g 0.1234 BTC) + value: + type: string + description: this parameter represents the monetary value as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0. + example: '20000' + valueAsDecimal: + type: number + description: the decimal value represents the monetary value with decimal precision derived from the value field, which is the integer representation in the smallest unit of the currency or token. + example: 20000 \ No newline at end of file diff --git a/openapi/components/globalTypes/id.yaml b/openapi/components/globalTypes/id.yaml new file mode 100644 index 0000000..6883e4a --- /dev/null +++ b/openapi/components/globalTypes/id.yaml @@ -0,0 +1,2 @@ +type: string +example: 'nKCMuD6h3Vsgs4mGDqGeV' diff --git a/openapi/components/globalTypes/invoicePaymentAmountDue.yaml b/openapi/components/globalTypes/invoicePaymentAmountDue.yaml new file mode 100644 index 0000000..3a9a8aa --- /dev/null +++ b/openapi/components/globalTypes/invoicePaymentAmountDue.yaml @@ -0,0 +1,26 @@ +type: object +properties: + rate: + type: string + description: the rate of conversion between the base currency of the invoice and, if applicable, the potential currency of payment + breakdown: + type: array + description: breakdown of all invoice amount components + items: + type: object + $ref: ./invoicePaymentAmountDueBreakdown.yaml + displayValue: + type: string + description: the value of the full invoice amount formatted for display (e.g 0.1234 BTC) + value: + type: string + description: this parameter represents the monetary value of the full invoice amount as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0 + currencyId: + type: string + description: the currency id of the wallet or address into which to payout to or Id of the native invoice currency + valueAsDecimal: + type: string + description: the decimal value represents the monetary value of the full invoice amount with decimal precision derinvoicePaymentAmountDue.yamlived from the value field, which is the integer representation in the smallest unit of the currency or token \ No newline at end of file diff --git a/openapi/components/globalTypes/invoicePaymentAmountDueBreakdown.yaml b/openapi/components/globalTypes/invoicePaymentAmountDueBreakdown.yaml new file mode 100644 index 0000000..39d828b --- /dev/null +++ b/openapi/components/globalTypes/invoicePaymentAmountDueBreakdown.yaml @@ -0,0 +1,21 @@ +type: object +properties: + name: + type: string + description: the name of the charge element or fee applied in the purchase + displayValue: + type: string + description: The value formatted for display (e.g 0.1234 BTC) + value: + type: string + description: this parameter represents the monetary value as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0 + currencyId: + type: string + description: the currency Id of the wallet or address into which to payout to or Id of the native invoice currency + valueAsDecimal: + type: string + description: the decimal value represents the monetary value with decimal precision derived from the value field, which is the integer representation in the smallest unit of the currency or token + diff --git a/openapi/components/globalTypes/logo.yaml b/openapi/components/globalTypes/logo.yaml new file mode 100644 index 0000000..55b7caa --- /dev/null +++ b/openapi/components/globalTypes/logo.yaml @@ -0,0 +1,8 @@ +type: object +properties: + imageUrl: + type: string + format: 'string' + vectorUrl: + type: string + format: 'string' diff --git a/openapi/components/globalTypes/notificationUrl.yaml b/openapi/components/globalTypes/notificationUrl.yaml new file mode 100644 index 0000000..60bb3b1 --- /dev/null +++ b/openapi/components/globalTypes/notificationUrl.yaml @@ -0,0 +1,3 @@ +type: string +description: url of your site where webhook notifications should be sent +example: 'https://site.com/api/{YOUR_WEBHOOK_PATH}' diff --git a/openapi/components/globalTypes/notifications.yaml b/openapi/components/globalTypes/notifications.yaml new file mode 100644 index 0000000..0fcacdb --- /dev/null +++ b/openapi/components/globalTypes/notifications.yaml @@ -0,0 +1,11 @@ +type: array +description: specify the event name you want your server to be notified about when it occurs, e.g. send notification when an invoice is created. + Provide values as a comma separated list of strings. If the list of notification events that merchant wants to receive is not + provided, the merchant will receive a "bad request" error in the response +example: ['invoiceCreated', + 'invoicePending', + 'invoicePaid', + 'invoiceCompleted', + 'invoiceCancelled', + 'invoiceTimedOut' + ] diff --git a/openapi/components/globalTypes/paging.yaml b/openapi/components/globalTypes/paging.yaml new file mode 100644 index 0000000..4cff038 --- /dev/null +++ b/openapi/components/globalTypes/paging.yaml @@ -0,0 +1,21 @@ +type: object +description: pagination of the response display +properties: + cursor: + type: object + properties: + before: + type: string + after: + type: string + limit: + type: integer + example: 0 + first: + type: string + next: + type: string + previous: + type: string + last: + type: string diff --git a/openapi/components/globalTypes/paymentAmountInvoiceRes.yaml b/openapi/components/globalTypes/paymentAmountInvoiceRes.yaml new file mode 100644 index 0000000..6531d1a --- /dev/null +++ b/openapi/components/globalTypes/paymentAmountInvoiceRes.yaml @@ -0,0 +1,17 @@ +type: object +properties: + currencySymbol: + type: string + description: symbol of the currency of the payment amount + currencyId: + type: string + description: payment currency id + displayValue: + type: string + description: payment amount as displayed in UI + value: + type: string + description: payment amount + valueAsDecimal: + type: number + description: payment amount in decimal format diff --git a/openapi/components/globalTypes/paymentFees-v1.yaml b/openapi/components/globalTypes/paymentFees-v1.yaml new file mode 100644 index 0000000..78226a0 --- /dev/null +++ b/openapi/components/globalTypes/paymentFees-v1.yaml @@ -0,0 +1,16 @@ +type: object +properties: + paymentSubTotal: + description: payment subtotal amount + $ref: ./paymentAmountInvoiceRes.yaml + merchantMarkupOrDiscount: + description: amount of discount or markup that merchant sets for the cryptocurrency + $ref: ./paymentAmountInvoiceRes.yaml + buyerFee: + description: amount of fees paid by the buyer + $ref: ./personFee-v1.yaml + merchantFee: + description: amount of fees paid by the merchant + $ref: ./personFee-v1.yaml + gross: + type: number diff --git a/openapi/components/globalTypes/paymentFees-v2.yaml b/openapi/components/globalTypes/paymentFees-v2.yaml new file mode 100644 index 0000000..bbad023 --- /dev/null +++ b/openapi/components/globalTypes/paymentFees-v2.yaml @@ -0,0 +1,17 @@ +type: object +properties: + paymentSubTotal: + description: payment subtotal amount + type: string + merchantMarkupOrDiscount: + description: amount of discount or markup that merchant sets for the cryptocurrency + type: string + buyerFee: + description: amount of fees paid by the buyer + $ref: ./personFee-v2.yaml + merchantFee: + description: amount of fees paid by the merchant + $ref: ./personFee-v2.yaml + gross: + type: string + description: total amount gross diff --git a/openapi/components/globalTypes/personFee-v1.yaml b/openapi/components/globalTypes/personFee-v1.yaml new file mode 100644 index 0000000..cd3ed61 --- /dev/null +++ b/openapi/components/globalTypes/personFee-v1.yaml @@ -0,0 +1,14 @@ +type: object +properties: + coinPaymentsFee: + description: fee amount charged by CoinPayments + $ref: ./paymentAmountInvoiceRes.yaml + networkFee: + description: network fee amount + $ref: ./paymentAmountInvoiceRes.yaml + conversionFee: + description: fee amount charged by conversion partners + $ref: ./paymentAmountInvoiceRes.yaml + total: + description: total fee amount + type: integer diff --git a/openapi/components/globalTypes/personFee-v2.yaml b/openapi/components/globalTypes/personFee-v2.yaml new file mode 100644 index 0000000..12de18f --- /dev/null +++ b/openapi/components/globalTypes/personFee-v2.yaml @@ -0,0 +1,14 @@ +type: object +properties: + coinPaymentsFee: + description: fee amount charged by CoinPayments + type: string + networkFee: + description: network fee amount + type: string + conversionFee: + description: fee amount charged by conversion partners + type: string + total: + description: total fee amount + type: integer diff --git a/openapi/components/globalTypes/personFeeSummary.yaml b/openapi/components/globalTypes/personFeeSummary.yaml new file mode 100644 index 0000000..9774df1 --- /dev/null +++ b/openapi/components/globalTypes/personFeeSummary.yaml @@ -0,0 +1,12 @@ +type: object +description: breakdown of additional fees paid by the buyer +properties: + "coin_payments_fee": + type: integer + description: fees charged by CoinPayments + "network_fee": + type: integer + description: amount of network fees charged for payment + "conversion_fee": + type: integer + description: fees charged for conversion \ No newline at end of file diff --git a/openapi/components/globalTypes/physicalAddress.yaml b/openapi/components/globalTypes/physicalAddress.yaml new file mode 100644 index 0000000..f46fd64 --- /dev/null +++ b/openapi/components/globalTypes/physicalAddress.yaml @@ -0,0 +1,26 @@ +type: object +properties: + address1: + type: string + description: main address + address2: + type: string + description: additional address data + address3: + type: string + description: additional address data + provinceOrState: + type: string + description: Province or state of the buyer + city: + type: string + description: city of the buyer + suburbOrDistrict: + type: string + description: Suburb or district of the buyer + countryCode: + type: string + description: country code + postalCode: + type: string + description: postal code \ No newline at end of file diff --git a/openapi/components/globalTypes/shipping.yaml b/openapi/components/globalTypes/shipping.yaml new file mode 100644 index 0000000..6f45203 --- /dev/null +++ b/openapi/components/globalTypes/shipping.yaml @@ -0,0 +1,20 @@ +type: object +properties: + method: + type: string + description: Shipment method + companyName: + type: string + description: receiver company name + name: + description: receiver name + $ref: ./fullName.yaml + emailAddress: + type: string + description: receiver email address + phoneNumber: + type: string + description: receiver phone number + address: + description: receiver address + $ref: ./physicalAddress.yaml diff --git a/openapi/components/globalTypes/token.yaml b/openapi/components/globalTypes/token.yaml new file mode 100644 index 0000000..59c1130 --- /dev/null +++ b/openapi/components/globalTypes/token.yaml @@ -0,0 +1,24 @@ +type: object +description: Monetary value (an amount with a currency and contract address) +properties: + contractAddress: + type: string + description: Blockchain address of the contract representing the token + nativeValue: + type: string + description: Token amount equivalent in native currency + nativeCurrencyId: + type: integer + description: id of the native currency of the wallet + displayValue: + type: string + description: the wallet balance value formatted for display + value: + type: string + description: this parameter represents the monetary value as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0. + valueAsDecimal: + type: string + description: the decimal value represents the monetary value with decimal precision derived from the value field, which is the integer representation in the smallest unit of the currency or token. \ No newline at end of file diff --git a/openapi/components/globalTypes/txId-or-hash.yaml b/openapi/components/globalTypes/txId-or-hash.yaml new file mode 100644 index 0000000..3c88ea9 --- /dev/null +++ b/openapi/components/globalTypes/txId-or-hash.yaml @@ -0,0 +1,2 @@ +type: string +format: '0x2446f1fd773fbb9f080e674b60c6a033c7ed7427b8b9413cf28a2a4a6da9b56c' diff --git a/openapi/components/globalTypes/walletAddress.yaml b/openapi/components/globalTypes/walletAddress.yaml new file mode 100644 index 0000000..a79dfec --- /dev/null +++ b/openapi/components/globalTypes/walletAddress.yaml @@ -0,0 +1,20 @@ +type: object +description: Represents a deposit address of a wallet on the CoinPayments® platform. +properties: + addressId: + type: string + description: the unique id of the address of the wallet + label: + type: string + description: user supplied or system generated label for this address + address: + type: string + description: the network address + notificationUrl: + type: string + description: if provided, webhook notifications will be sent to this address when new deposit is received + rentedTill: + type: string + description: date and time until account-based address is in lease by the merchant. If no new deposit is made to the + address until the indicated date and time, the address returns to the pool of CoinPayments addresses + diff --git a/openapi/components/headers/ExpiresAfter.yaml b/openapi/components/headers/ExpiresAfter.yaml new file mode 100644 index 0000000..0cbe9a5 --- /dev/null +++ b/openapi/components/headers/ExpiresAfter.yaml @@ -0,0 +1,4 @@ +description: date in UTC when token expires +schema: + type: string + format: date-time diff --git a/openapi/components/responses/Problem.yaml b/openapi/components/responses/Problem.yaml new file mode 100644 index 0000000..f66a55e --- /dev/null +++ b/openapi/components/responses/Problem.yaml @@ -0,0 +1,5 @@ +description: Problem +content: + application/problem+json: + schema: + $ref: ../schemas/Problem.yaml \ No newline at end of file diff --git a/openapi/components/responses/Webhooks/CreateCallbackAddress.yaml b/openapi/components/responses/Webhooks/CreateCallbackAddress.yaml new file mode 100644 index 0000000..149b7a2 --- /dev/null +++ b/openapi/components/responses/Webhooks/CreateCallbackAddress.yaml @@ -0,0 +1,45 @@ +type: object +properties: + id: + description: callback address id + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + clientId: + description: client Id + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + created: + description: date and time of creating the callback address + type: string + example: '2022-10-11T14:34:32.945Z' + currencyId: + description: currency Id + type: number + example: 1 + contractAddress: + description: 'the address of the contract if this money object represents an ERC20 or similar token value' + type: string + example: 'Asaiuqhdaknxyuiw21w2w2223' + label: + description: label for callback address + type: string + example: 'John Doe`s address' + updatedAt: + description: date of last time the wallet data was modified by the user + type: string + example: '2022-10-05T06:05:07.520Z' + depositAddress: + description: address to deposit funds into the wallet + type: string + example: 'Asaiuqhdaknxyuiw21w2w2223' + walletStatus: + description: status of the wallet in the system + type: string + example: unknown + canCreateAddress: + description: indicates whether the wallet can create an address + type: boolean + example: true + webhook: + $ref: ../../schemas/callbacks/webhookSchema.yaml + diff --git a/openapi/components/responses/Webhooks/webhook-payload.yaml b/openapi/components/responses/Webhooks/webhook-payload.yaml new file mode 100644 index 0000000..4b40b24 --- /dev/null +++ b/openapi/components/responses/Webhooks/webhook-payload.yaml @@ -0,0 +1,540 @@ +type: object +properties: + id: + description: address id + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + type: + description: event type ( e.g "invoiceCreated", "invoiceComplete",.. ) + type: string + example: 'invoiceCreated' + timestamp: + description: date and time of producing the event + type: string + example: '2023-04-07T06:58:19.9798764+00:0' + invoice: + type: object + description: details of the invoice to which refers the webhook notification + properties: + "invoiceId": + type: string + description: invoice number assigned by the merchant + "id": + type: string + description: invoice id assigned by the system + "userId": + type: string + description: the id of the merchant creating this invoice + "merchantId": + type: string + description: the id of the merchant creating this invoice + "merchantClientId": + type: string + description: the id of the client API integration creating this invoice + "invoiceNumber": + type: string + description: invoice number assigned by the merchant + "invoiceNumberSuffix": + type: string + description: suffix of the invoice number assigned by the merchant + "createdAt": + type: string + description: timestamp when invoice was created + "invoiceDate": + type: string + description: date when invoice was issued + "dueDate": + type: string + description: date when invoice is due to be paid + "description": + type: string + description: description of the invoice + "expiresDate": + type: string + description: date when invoice expires + "customData": + type: object + description: any custom data merchant wishes to attach to the invoice that may be further used for custom + merchant's purposes. Not visible on UI for buyers + properties: + additionalProp1: + type: string + additionalProp2: + type: string + additionalProp3: + type: string + "notes": + type: string + description: notes for the merchant only, these are not visible to the buyers + "notesToRecipient": + type: string + description: any additional information to share with the buyer about the transaction + "buyerDataCollectionMessage": + type: string + description: the message to display when collecting buyer user data + "termsAndConditions": + type: string + description: any terms and conditions, e.g. a cancellation policy + "metadata": + type: object + properties: + integration: + type: string + description: integration name + format: InvoiceBuilder + hostname: + type: string + description: server name of the integration API + "poNumber": + type: string + description: optional Purchase order number on the integration API. + format: InvoiceBuilder + "buyer": + type: object + description: buyer's data + properties: + "companyName": + type: string + description: name of the buyer's company + "email": + type: string + description: buyer's email address + "firstName": + type: string + description: buyer's name + "lastName": + type: string + description: buyer's last name + "phoneNumber": + type: string + description: buyer's phone number + "address": + $ref: ../../globalTypes/physicalAddress.yaml + "shipping": + description: shipping method details + $ref: ../../globalTypes/shipping.yaml + "lineItems": + type: object + description: purchase item data + properties: + "amount": + type: string + description: purchase cost + "customId": + type: string + description: id of the purchase item in merchant's system + "description": + type: string + description: description of the purchase item + "name": + type: string + description: name of purchase item + "originalAmount": + type: string + description: purchase item cost + "quantity": + type: integer + description: quantity of the purchase items bought + "sku": + type: string + description: purchase item SKU number + "tax": + type: string + description: tax amount + "type": + type: string + description: purchase item type + "merchantOptions": + description: merchant's details to be shown on the invoice + $ref: ../../schemas/invoices/merchantOptions.yaml + "emailDeliveryOptions": + type: object + description: email addresses to be used for invoice delivery + properties: + to: + type: string + description: to email address. The value can take multiple addresses separated by semicolons + cc: + type: string + description: field to add multiple recipients separated by semicolons + bcc: + type: string + description: bcc field similar to "cc" field except that other recipients won't be able to see that someone else has been sent a copy of the email + "amount": + type: object + description: invoice amount + properties: + "currencyId": + type: integer + description: id of the currency in the system + "subtotal": + type: string + description: subtotal amount of the purchase + "shippingTotal": + type: string + description: shipping amount of the purchase + "handlingTotal": + type: string + description: handling service amount of the purchase + "discountTotal": + type: string + description: discount amount of the purchase + "taxTotal": + type: string + description: tax amount of the purchase + "total": + type: string + description: total amount of the purchase + "state": + type: string + description: current status of the invoice + "flags": + type: object + properties: + "requireBuyerNameAndEmail": + type: boolean + description: if buyer's email and name required + "sendPaymentCompleteEmailNotification": + type: boolean + description: if sending of the payment completion email required + "isPos": + type: boolean + description: if point of sale required + "canceledAt": + type: integer + description: time when invoice is canceled + "completedAt": + type: integer + description: time when invoice is completed + "confirmedAt": + type: integer + description: time when invoice is confirmed + "payments": + type: array + description: details of the invoice payment + items: + type: object + description: payment details + properties: + id: + type: string + description: payment id + "invoiceId": + type: string + description: invoice id + "createdAt": + type: integer + description: time when payment is created + "expiresAt": + type: integer + description: time when payment expires + "cancelledAt": + type: integer + description: time when invoice is canceled + "detectedAt": + type: integer + description: time when payment is detected in mempool or on chain + "pendingAt": + type: integer + description: time when invoice is identified as pending + "confirmedAt": + type: integer + description: time when payment is confirmed + "completedAt": + type: integer + description: time when payment is completed + "scheduledAt": + type: integer + description: time when invoice is scheduled for sending out + "state": + type: string + description: payment/invoice status. Available values are "unpaid", "Pending", "Paid", "Completed", "Cancelled", "TimedOut" + "refundedAt": + type: integer + description: time when payment is refunded + "refundEmail": + type: string + description: email for making refund + "isGuest": + type: boolean + description: if payer is a system guest or a registered user + "hotWallet": + type: object + description: object containing data about payment amount and pooled wallet where payment is sent + properties: + "nativeCurrency": + type: object + description: default fiat currency of the merchant's settings for displaying payment amount in fiat + properties: + "id": + type: integer + description: fiat currency id + "smartContract": + type: string + description: currency smart contract. Default - null + "paymentSubTotalInNativeCurrency": + type: integer + description: amount of payment in the default fiat currency + "merchantMarkupOrDiscountInNativeCurrency": + type: integer + description: markup or discount amount to the payment amount in the default fiat currency + "buyerFeeInNativeCurrency": + type: object + description: fee amount charged from the buyer in the default fiat currency + properties: + "coinPaymentsFee": + type: integer + description: amount of fee charged from buyer by CoinPayments in the default fiat currency + "networkFee": + type: integer + description: amount of the network fee charged from buyer in the default fiat currency + "conversionFee": + type: integer + description: amount of conversion fee charged from the buyer in the default fiat currency + "merchantFeeInNativeCurrency": + type: object + description: fee amount charged from the merchant in the default fiat currency + properties: + "coinPaymentsFee": + type: integer + description: amount of fee charged from merchant by CoinPayments in the default fiat currency + "networkFee": + type: integer + description: amount of the network fee charged from merchant in the default fiat currency + "conversionFee": + type: integer + description: amount of conversion fee charged from merchant in the default fiat currency + "confirmedAmountInNativeCurrency": + type: integer + description: confirmed amount of payment in the default fiat currency + "unconfirmedAmountInNativeCurrency": + type: integer + description: unconfirmed amount of payment in the default fiat currency + "id": + type: string + description: wallet id + "paymentId": + type: string + description: payment id + "currency": + type: object + description: payment currency details + properties: + "id": + type: integer + description: payment currency id + "smartContract": + type: object + description: payment smart contract details + "merchantPayoutCurrency": + type: object + description: details of the payout currency of the merchant balance + properties: + "id": + type: integer + description: payout currency id + "smartContract": + type: object + description: payout currency smart contract details + "currencyRateFromInvoiceCurrency": + type: integer + description: rate of the payment currency to the invoice currency + "paymentReceiveAddress": + type: string + description: address of payment is received + "merchantPayoutAddress": + type: string + description: address to payout funds to the merchant + "merchantPayoutWalletId": + type: string + description: id of the payout wallet of the merchant + "paymentSubTotal": + type: string + description: invoice amount subtotal + "merchantMarkupOrDiscount": + type: integer + description: amount of the discount provided by the merchant for the currency + "isConversion": + type: boolean + description: if conversion is required by payout settings of the merchant for the currency of payment + "buyerFee": + type: object + description: breakdown of additional fees paid by the buyer + $ref: ../../globalTypes/personFeeSummary.yaml + "merchantFee": + type: object + description: breakdown of additional fees paid by the merchant + $ref: ../../globalTypes/personFeeSummary.yaml + "payoutFrequency": + type: string + description: frequency mode for funds payout set by the merchant + "createdAt": + type: integer + description: time when payout is created + "error": + type: object + description: payment error details + properties: + code: + type: string + description: error code + message: + type: string + description: error message + example: ['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": + type: integer + description: amount of confirmations gathered by the payment transaction on chain. Deposits require a + specific number of blockchain confirmations to release the funds for payout. Sending goods or + crediting funds to the customer prior to receiving the full number of confirmations shall be done at + merchant's own risk. + "confirmedAmount": + type: integer + description: amount of payment that received necessary amount of confirmation on chain + "requiredConfirmations": + type: integer + description: amount of confirmations required for the payment currency for the transaction to be completed. + Deposits require a + specific number of blockchain confirmations to release the funds for payout. Sending goods or + crediting funds to the customer prior to receiving the full number of confirmations shall be done at + merchant's own risk. + "unconfirmedAmount": + type: integer + description: amount of payment that was detected on chain but that has not received necessary amount of confirmations yet + "assignment": + type: object + description: dates of assignment of the pooled wallet to the hot wallet for payment + properties: + "assignedFrom": + type: string + description: timestamp from when assignment of the pooled wallet to the hot wallet is valid + "assignedUntil": + type: string + description: timestamp until assignment of the pooled wallet to the hot wallet is valid + "completedDate": + type: string + description: timestamp when assignment of the pooled wallet to the hot wallet is completed + "pooledWalletId": + type: string + description: id of the wallet in the pool of addresses used for payment receipt + "expiresAt": + type: integer + description: time when pooled wallet returns to the system pool of addresses + "payout": + type: object + description: payout mode details + properties: + "destinationAmountInNativeCurrency": + type: integer + description: payment amount without deduction of fees in default fiat currency + "payoutAmountToMerchantInNativeCurrency": + type: integer + description: final amount with deduction of fees to be paid out to the merchant in default fiat currency + "buyerBlockchainFeeAfterGroupingInNativeCurrency": + type: integer + description: network fee paid by buyer in default fiat currency + "merchantBlockchainFeeAfterGroupingInNativeCurrency": + type: integer + description: network fee paid by merchant in default fiat currency + "id": + type: string + description: payout id + "invoicePaymentId": + type: string + description: id of the invoice payment + "invoicePaymentHotWalletId": + type: string + description: id of the hot wallet for receiving invoice payment + "created": + type: string + description: date and time when payment was created + "sent": + type: string + description: date and time when payment was sent + "confirmed": + type: string + description: date and time when payment was confirmed on chain + "failed": + type: string + description: date and time when payment failure was detected + "merchantPayoutWalletId": + type: string + description: id of the wallet where payout is made for the merchant + "merchantPayoutWalletCurrencyId": + type: integer + description: id of the currency of the wallet used for payout for the merchant + "merchantPayoutWalletSmartContract": + type: object + description: details of the smart contract of the currency of the wallet where payout is made for the merchant + "merchantPayoutAddress": + type: string + description: id of the merchant external payout address + "payoutAmountToMerchant": + type: integer + description: amount to be paid out to merchant to the payout address + "blockchainTransactionId": + type: string + description: id of the transaction on blockchain for sending paid out amount to the external merchant's address + "state": + type: string + description: current state of the payment + "batchId": + type: string + description: id of the transaction batch within which CoinPayments sends paid out amount to the merchant's external address + "destinationAmount": + type: integer + description: amount of payment without deduction of fees + "transactionId": + type: integer + description: payout transaction id in CoinPayments system + "buyerBlockchainFeeAfterGrouping": + type: integer + description: network fee paid by buyer + "merchantBlockchainFeeAfterGrouping": + type: integer + description: network fee paid by merchant + "refund": + type: object + description: refund details + properties: + "payoutAmountInNativeCurrency": + type: integer + description: amount that was refunded in the default fiat currency + "payoutNetworkFeesInNativeCurrency": + type: integer + description: actual amount of blockchain network fees for putting refund transaction on chain in the default fiat currency + "estimatedNetworkFeesInNativeCurrency": + type: integer + description: estimated amount of blockchain network fees for putting refund transaction on chain in the default fiat currency + "isActive": + type: boolean + description: if payment is active or expired + "payoutConfig": + type: object + description: config details of the payout mode + $ref: ../../schemas/invoices/payouts/PayoutConfig.yaml + "partialAcceptAvailable": + type: boolean + description: if accepting partial payment is possible + + + diff --git a/openapi/components/responses/clients/createWebhook.yaml b/openapi/components/responses/clients/createWebhook.yaml new file mode 100644 index 0000000..51a4b2e --- /dev/null +++ b/openapi/components/responses/clients/createWebhook.yaml @@ -0,0 +1,6 @@ +type: object +properties: + id: + type: string + description: Id of webhook integration + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' diff --git a/openapi/components/responses/clients/itemRes.yaml b/openapi/components/responses/clients/itemRes.yaml new file mode 100644 index 0000000..1cdaac4 --- /dev/null +++ b/openapi/components/responses/clients/itemRes.yaml @@ -0,0 +1,12 @@ +type: object +properties: + id: + type: string + description: id of the webhook integration + example: 'wLKBuD6h3Vama4mGDqHeF' + notificationUrl: + $ref: ../../globalTypes/notificationUrl.yaml + notifications: + $ref: ../../globalTypes/notifications.yaml + paging: + $ref: ../../globalTypes/paging.yaml diff --git a/openapi/components/responses/clients/list-webhooks.yaml b/openapi/components/responses/clients/list-webhooks.yaml new file mode 100644 index 0000000..1c8be25 --- /dev/null +++ b/openapi/components/responses/clients/list-webhooks.yaml @@ -0,0 +1,6 @@ +type: object +description: List of merchant webhook notifications +properties: + items: + $ref: ./itemRes.yaml + diff --git a/openapi/components/responses/invoices/address-by-currency-v1.yaml b/openapi/components/responses/invoices/address-by-currency-v1.yaml new file mode 100644 index 0000000..98ebf6c --- /dev/null +++ b/openapi/components/responses/invoices/address-by-currency-v1.yaml @@ -0,0 +1,26 @@ +type: object +description: Address for buyer to make payment with indication of currency, amount, and expiration timer +properties: + currency: + $ref: ../../schemas/currencies/currencySchema.yaml + amount: + type: object + description: amount of purchase + $ref: ../../globalTypes/invoicePaymentAmountDue.yaml + addresses: + type: object + description: addresses where payments to an invoice can be sent + properties: + address: + type: string + description: raw payment address + biP21: + type: string + description: BIP21 payment code, if available + expires: + type: string + description: date and time when payment expires and a new payment must be started to send payment + remainingAmount: + type: object + description: remaining amount to be paid on the invoice to the payment address in case partial payment has been made + $ref: ../../globalTypes/globalAmount.yaml diff --git a/openapi/components/responses/invoices/address-by-currency-v2.yaml b/openapi/components/responses/invoices/address-by-currency-v2.yaml new file mode 100644 index 0000000..6bc17ed --- /dev/null +++ b/openapi/components/responses/invoices/address-by-currency-v2.yaml @@ -0,0 +1,25 @@ +type: object +description: Address for buyer to make payment with indication of currency, amount, and expiration timer +properties: + currency: + $ref: ../../schemas/currencies/currencySchema.yaml + amount: + type: string + description: amount of purchase + remainingAmount: + type: object + description: remaining amount to be paid on the invoice to the payment address in case partial payment has been made + addresses: + type: object + description: addresses where payments to an invoice can be sent + properties: + address: + type: string + description: raw payment address + biP21: + type: string + description: BIP21 payment code, if available + expires: + type: string + description: date and time when payment expires and a new payment must be started to send payment + diff --git a/openapi/components/responses/invoices/createInvoiceRes-v1.yaml b/openapi/components/responses/invoices/createInvoiceRes-v1.yaml new file mode 100644 index 0000000..8825100 --- /dev/null +++ b/openapi/components/responses/invoices/createInvoiceRes-v1.yaml @@ -0,0 +1,47 @@ +type: object +properties: + invoices: + type: array + description: Invoice in all available currencies + items: + type: object + properties: + id: + type: string + description: id of the invoice + link: + type: string + description: link to the invoice document + checkoutLink: + type: string + description: the link to the CoinPayments checkout page where buyer can see address, QR code and timer for payment + payment: + type: object + description: payment details + properties: + paymentId: + type: string + description: id of the payment + expires: + type: string + description: the timestamp when the payment expires and new payments will no longer be accepted + example: '2023-09-02T08:06:26+00:00' + paymentCurrencies: + type: array + description: details of the currency in which payment can be done together with the breakdown of the invoice amount in this currency + items: + $ref: ./invoicePaymentCur-v1.yaml + refundEmail: + type: string + description: email address provided by the buyer for the case when refund should be executed, e.g. some problem with payment or overpayment has occurred + hotWallet: + type: object + description: payment address information for sending funds for the invoice. Is added to this response body + in case payment currency id is specified in the 'createInvoice' request. In case 'paymentCurrency' + is not specified in the 'createInvoice' request, the response will contain the list of all available currencies + for payment. Selecting the address for payment should be triggered as a separate action by using + 'getPaymentAddressByCurrency' endpoint + $ref: ../../responses/invoices/address-by-currency-v1.yaml + + + diff --git a/openapi/components/responses/invoices/createInvoiceRes-v2.yaml b/openapi/components/responses/invoices/createInvoiceRes-v2.yaml new file mode 100644 index 0000000..c8e8e4b --- /dev/null +++ b/openapi/components/responses/invoices/createInvoiceRes-v2.yaml @@ -0,0 +1,47 @@ +type: object +properties: + invoices: + type: array + description: Invoice in all available currencies + items: + type: object + properties: + id: + type: string + description: id of the invoice + link: + type: string + description: link to the invoice document + checkoutLink: + type: string + description: the link to the CoinPayments checkout page where buyer can see address, QR code and timer for payment + payment: + type: object + description: payment details + properties: + paymentId: + type: string + description: id of the payment + expires: + type: string + description: the timestamp when the payment expires and new payments will no longer be accepted + example: '2023-09-02T08:06:26+00:00' + paymentCurrencies: + type: array + description: details of the currency in which payment can be done together with the breakdown of the invoice amount in this currency + items: + $ref: ./invoicePaymentCur-v2.yaml + refundEmail: + type: string + description: email address provided by the buyer for the case when refund should be executed, e.g. some problem with payment or overpayment has occurred + hotWallet: + type: object + description: payment address information for sending funds for the invoice. Is added to this response body + in case payment currency id is specified in the 'createInvoice' request. In case 'paymentCurrency' + is not specified in the 'createInvoice' request, the response will contain the list of all available currencies + for payment. Selecting the address for payment should be triggered as a separate action by using + 'getPaymentAddressByCurrency' endpoint + $ref: ../../responses/invoices/address-by-currency-v2.yaml + + + diff --git a/openapi/components/responses/invoices/getInvoicesRes-v1.yaml b/openapi/components/responses/invoices/getInvoicesRes-v1.yaml new file mode 100644 index 0000000..2815563 --- /dev/null +++ b/openapi/components/responses/invoices/getInvoicesRes-v1.yaml @@ -0,0 +1,276 @@ +type: object +properties: + items: + type: array + description: list of all merchant's invoices + items: + type: object + properties: + id: + type: string + description: unique invoice id with CoinPayments + invoiceId: + type: string + description: invoice id set by the merchant + invoiceIdSuffix: + type: string + description: the optional numeric suffix used when the invoice is emailed to multiple customers + created: + type: string + description: the timestamp when the invoice entity was created + invoiceDate: + type: string + description: the date of the invoice, either the system created date or custom date + specified by the merchant + dueDate: + type: string + description: optional due date of the invoice + confirmed: + type: string + description: the timestamp when the payment for the invoice is detected by CoinPayments on the blockchain + completed: + type: string + description: the timestamp when the invoice is paid out to the merchant + cancelled: + type: string + description: >- + the timestamp when the invoice is manually cancelled by the merchant + currency: + type: object + description: currency in which invoice is issued + properties: + id: + type: string + description: currency id + symbol: + type: string + description: currency symbol + name: + type: string + description: currency name + token: + type: object + description: currency token in which invoice is issued + properties: + name: + type: string + description: token name + symbol: + type: string + description: token symbol + contractAddress: + type: string + description: token contract address + decimalPlaces: + type: integer + description: number of decimal places for displaying the invoice amount + format: int32 + logo: + $ref: ../../globalTypes/logo.yaml + decimalPlaces: + type: integer + format: int32 + buyer: + type: object + description: buyer details + properties: + companyName: + type: string + description: buyer's company name + name: + description: buyer's name + $ref: ../../globalTypes/fullName.yaml + emailAddress: + type: string + description: buyer's email + phoneNumber: + type: string + description: buyer's phone number + address: + $ref: ../../globalTypes/physicalAddress.yaml + hasData: + type: boolean + description: + type: string + description: the purchase description + amount: + type: object + required: + - currencyId + - value + description: invoice amount + properties: + currencySymbol: + type: string + description: symbol of the currency of the invoice amount + currencyId: + type: string + description: invoice currency id + displayValue: + type: string + description: invoice amount as displayed in UI + value: + type: string + description: invoice amount + valueAsDecimal: + type: number + description: invoice amount in decimal format + shipping: + description: shipping address + $ref: ../../globalTypes/physicalAddress.yaml + status: + type: string + description: status of the invoice. Possible values - 'draft', 'scheduled', 'unpaid', 'pending', 'paid', 'completed', + 'cancelled', 'timedOut', 'deleted' + metadata: + type: object + description: invoice metadata + properties: + integration: + type: string + description: the integration from which the invoice was created + payments: + type: array + description: payment details in all currencies supported by the merchant + items: + type: object + description: payment details + properties: + expectedAmount: + description: gross payment amount in the currency of payment + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + nativeExpectedAmount: + description: gross payment amount in the fiat currency + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + actualAmount: + description: net payment amount in the currency of payment + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + nativeActualAmount: + description: net payment amount in the fiat currency + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + paymentAddress: + type: string + description: address where funds are sent + errorCode: + type: string + description: payment error. Possible values - 'unknown', 'negativeRate', 'payoutAddressIsNull', + 'paymentSubTotalIsLessThanMerchantTotalFee', 'totalBuyerWillPayIsNegativeOrZero', 'totalBuyerWillPayIsLessThanBuyerNetworkFee', + 'totalMerchantFeeRatioIsMoreThanMaximumRatioSetting', 'payoutAmountIsLessThanDust', 'currencyIsNotActive', + 'amountIsBelowOfConversionLimit', 'amountIsAboveOfConversionLimit', 'userLimitIsReached', 'notEnoughToActivateRippleAddress', + 'conversionPairDoesNotExist', 'addressIsNotValid', 'doesNotHaveCompletedKyc', 'unstoppableDomainNotFound', + 'unstoppableDomainNotFoundForCurrency', 'userWalletIsLocked', 'userWalletIsDeleted', 'largeWithdrawalRejected' + fees: + description: payment fees in cryptocurrency + $ref: ../../globalTypes/paymentFees-v1.yaml + nativeFees: + description: payment fees in fiat + $ref: ../../globalTypes/paymentFees-v1.yaml + payout: + type: object + required: + - currencyId + - value + description: payout details of the payment + properties: + scheduledAt: + type: string + description: date and time when the payout will be made + completedAt: + type: string + description: date and time when the payout has been completed + blockchainTx: + type: string + description: transaction id on the blockchain + spendRequestId: + type: string + description: id of the spend request in CoinPayments system for the payout with conversion + address: + type: string + description: address of the payout + walletId: + type: string + description: id of the wallet where payout address belongs + sentAt: + type: string + description: date and time when invoice was sent to the buyer + expectedExecutionDate: + type: string + description: date and time when invoice completion is expected + receivedBlockchainTx: + type: string + description: id of the payment transaction on the blockchain + currencySymbol: + type: string + description: symbol of the payout currency + currencyId: + type: string + description: id of the payout currency + displayValue: + type: string + description: payout amount as displayed in UI + value: + type: string + description: payout amount + valueAsDecimal: + type: number + description: payout amount in decimal format + nativePayout: + description: payout amount in fiat + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + refundEmail: + type: string + description: buyer's email that can be used for refund + state: + type: string + description: payment status. Possible values are - 'created', 'detected', 'pending', 'confirmed', 'scheduledForPayout', + 'completed', 'cancelledWaitingRefund', 'timedOutWaitingRefund', 'timedOutRefundProcessed', 'cancelledRefundProcessed', 'refunded' + isActive: + type: boolean + description: payment state + pendingAt: + type: string + description: date and time when payment is detected on the blockchain + confirmedAt: + type: string + description: date and time when payment receives first confirmation on the blockchain + completedAt: + type: string + description: date and time when payment receives all required confirmation on the blockchain + confirmations: + type: integer + description: number of confirmation payment received on the blockchain + requiredConfirmations: + type: integer + description: number of required confirmations for the payment to be considered completed + isEmailDelivery: + type: boolean + description: indicates if invoice is to be delivered by email + emailDelivery: + type: object + description: email addresses to be used for invoice delivery + properties: + to: + type: string + description: to email address. The value can take multiple addresses separated by semicolons + cc: + type: string + description: field to add multiple recipients separated by semicolons + bcc: + type: string + description: bcc field similar to "cc" field except that other recipients won't be able to see that someone else has been sent a copy of the email + notes: + type: string + description: notes added to the invoice by the merchant + notesToRecipient: + type: string + description: notes added to the invoice by the merchant for the buyer + partialAcceptAvailable: + type: boolean + description: flag that indicates that partial payment of the invoice can be accepted by the merchant automatically + isLifeTimeFinished: + type: boolean + description: flag that indicates that invoice has not yet expired + expires: + type: string + description: date and time when invoice will expire + diff --git a/openapi/components/responses/invoices/getInvoicesRes-v2.yaml b/openapi/components/responses/invoices/getInvoicesRes-v2.yaml new file mode 100644 index 0000000..7362228 --- /dev/null +++ b/openapi/components/responses/invoices/getInvoicesRes-v2.yaml @@ -0,0 +1,491 @@ +type: object +properties: + items: + type: array + description: list of all merchant's invoices + items: + type: object + properties: + id: + type: string + description: unique invoice id with CoinPayments + invoiceId: + type: string + description: invoice id set by the merchant + invoiceIdSuffix: + type: string + description: the optional numeric suffix used when the invoice is emailed to multiple customers + created: + type: string + description: the timestamp when the invoice entity was created + invoiceDate: + type: string + description: the date of the invoice, either the system created date or custom date + specified by the merchant + dueDate: + type: string + description: optional due date of the invoice + confirmed: + type: string + description: the timestamp when the payment for the invoice is detected by CoinPayments on the blockchain + completed: + type: string + description: the timestamp when the invoice is paid out to the merchant + cancelled: + type: string + description: >- + the timestamp when the invoice is manually cancelled by the merchant + expires: + type: string + description: date and time when invoice will expire + currency: + type: object + description: currency in which invoice is issued + properties: + id: + type: string + description: currency id + symbol: + type: string + description: currency symbol + name: + type: string + description: currency name + token: + type: object + description: currency token in which invoice is issued + properties: + name: + type: string + description: token name + symbol: + type: string + description: token symbol + contractAddress: + type: string + description: token contract address + decimalPlaces: + type: integer + description: number of decimal places for displaying the invoice amount + format: int32 + logo: + $ref: ../../globalTypes/logo.yaml + decimalPlaces: + type: integer + format: int32 + merchant: + type: object + description: merchant details + properties: + id: + type: string + description: id of the merchant within CoinApyments system + name: + type: string + description: merchant's name + uboName: + type: string + description: merchant's UBO name + websiteUrl: + type: string + description: URL of the merchant's website + country: + type: string + description: merchant's country + logoUrl: + type: string + description: merchant's logo + email: + type: string + description: merchant's email + address: + type: string + description: merchants address + phone: + type: string + description: merchant's phone number + description: + type: string + description: description of the merchant + registrationNumber: + type: string + description: merchant's registration number + merchantOptions: + description: options of the merchant entity + type: object + properties: + showAddress: + type: boolean + description: flag that indicates whether merchant's address should be displayed on the invoice + showEmail: + type: boolean + description: flag that indicates whether merchant's email should be displayed on the invoice + showPhone: + type: boolean + description: flag that indicates whether merchant's phone number should be displayed on the invoice + showRegistrationNumber: + type: boolean + description: flag that indicates whether merchant's register number should be displayed on the invoice + additionalInfo: + type: string + description: flag that indicates whether merchant's additional information should be displayed on the invoice + buyer: + type: object + description: buyer details + properties: + companyName: + type: string + description: buyer's company name + name: + description: buyer's name + $ref: ../../globalTypes/fullName.yaml + emailAddress: + type: string + description: buyer's email + phoneNumber: + type: string + description: buyer's phone number + address: + $ref: ../../globalTypes/physicalAddress.yaml + hasData: + type: boolean + description: + type: string + description: the purchase description + items: + type: array + description: array of items that a buyer intends to purchase from the merchant + items: + $ref: ../../schemas/invoices/items-v2.yaml + amount: + type: object + required: + - breakdown + - total + description: detailed amount of purchase with the breakdown of all fees + properties: + breakdown: + type: object + required: + - subtotal + properties: + subtotal: + description: sum of purchased items + type: string + shipping: + description: cost of shipping + type: string + handling: + description: service cost for processing order + type: string + taxTotal: + description: tax cost + type: string + discount: + description: discount amount + type: string + total: + description: total amount of the invoice + type: string + shipping: + description: shipping address + $ref: ../../globalTypes/physicalAddress.yaml + customData: + type: object + description: any custom data merchant wishes to attach to the invoice that may be further used for custom merchant's purposes. Not visible on UI for buyers + status: + type: string + description: status of the invoice. Possible values - 'draft', 'scheduled', 'unpaid', 'pending', 'paid', 'completed', + 'cancelled', 'timedOut', 'deleted' + requireBuyerNameAndEmail: + type: boolean + description: flag indicating whether a buyer name and email are required, they will be requested at checkout if not provider by the caller. + buyerDataCollectionMessage: + type: string + description: the message to display when collecting buyer user data + notes: + type: string + description: notes added to the invoice by the merchant + notesToRecipient: + type: string + description: notes added to the invoice by the merchant for the buyer + termsAndConditions: + type: string + description: any terms and conditions, e.g. a cancellation policy + emailDelivery: + type: object + description: email addresses to be used for invoice delivery + properties: + to: + type: string + description: to email address. The value can take multiple addresses separated by semicolons + cc: + type: string + description: field to add multiple recipients separated by semicolons + bcc: + type: string + description: bcc field similar to "cc" field except that other recipients won't be able to see that someone else has been sent a copy of the email + isEmailDelivery: + type: boolean + description: indicates if invoice is to be delivered by email + metadata: + type: object + description: invoice metadata + properties: + integration: + type: string + description: the integration from which the invoice was created + hostName: + type: string + description: name of the host + poNumber: + type: string + description: optional Purchase order number on the integration API + payoutDetails: + type: object + description: details of the merchant payout settings for the payment + properties: + paidTransactions: + type: array + description: list of payment transactions for the invoice + items: + type: object + properties: + hash: + type: string + description: transaction hash + amount: + description: transaction amount + $ref: ../../globalTypes/amount.yaml + conversionId: + type: integer + description: id of the conversion transaction if payout mode is with conversion + format: int64 + paidDate: + type: string + description: date of payment + completedTxId: + type: string + description: id of the transaction that received enough confirmations on the blockchain + externalAddress: + type: string + description: address where payout is made, if payout mode is "To Address" + destinationCurrencyId: + type: string + description: id of the payout currency + expectedDisplayValue: + type: string + description: expected gross payout amount + sourceCurrencyId: + type: string + description: original currency of payment transaction + destinationWalletId: + type: string + description: id of the wallet for payout + isConversion: + type: boolean + description: if payout mode is with conversion + conversionProgress: + type: number + format: double + description: stage of the conversion at the payout + settlementModeErrorCode: + type: integer + format: int32 + description: error code for payout settlement + destinationAmount: + type: object + description: net payout amount + properties: + amount: + type: object + description: net payout amount in crypto + $ref: ../../globalTypes/amount.yaml + nativeAmount: + type: object + description: net payout amount in fiat + $ref: ../../globalTypes/amount.yaml + receivedBlockchainTxId: + type: string + description: id of the payment transaction on the blockchain + items: + type: array + description: invoice payout details + items: + type: object + properties: + currency: + type: object + description: currency of payout + $ref: ../../globalTypes/currency.yaml + merchantFees: + type: object + description: fees paid by the merchant + properties: + transactionFee: + description: CoinPayments fee + $ref: ../../globalTypes/amount.yaml + networkFee: + description: blockchain fee + $ref: ../../globalTypes/amount.yaml + conversionFee: + description: fee for conversion in case payout mode is with conversion + $ref: ../../globalTypes/amount.yaml + payoutAmount: + description: amount to be paid out to the merchant in crypto + $ref: ../../globalTypes/amount.yaml + payoutAmountInInvoiceCurrency: + description: amount to be paid out to the merchant in fiat + $ref: ../../globalTypes/amount.yaml + merchantPayoutAddress: + type: string + description: merchant's address where funds to be paid out + created: + type: string + description: date and time when payout transaction is created by CoinPayments + sent: + type: string + description: date and time when payout transaction is sent to the merchant by CoinPayments + expected: + type: string + description: date and time when payout transaction is expected to be delivered to the merchant + confirmed: + type: string + description: date and time when payout transaction get on the blockchain in case payout mode is with conversion or to an external address + state: + type: string + description: status of the payout, possible values are - 'scheduled', 'sending', 'sent', 'confirmed', + 'waitingConversion', 'failed', 'waitingInternalReceive', 'waitingExternalConfirm' + paging: + $ref: ../../globalTypes/paging.yaml + payments: + type: array + description: payment details in all currencies supported by the merchant + items: + type: object + description: payment details + properties: + paymentCurrencyId: + type: string + description: id of the payment currency + paymentCurrencySymbol: + type: string + description: symbol of the payment currency + nativeCurrencyId: + type: string + description: id of the invoice currency + nativeCurrencySymbol: + type: string + description: symbol of the invoice currency + expectedAmount: + description: gross payment amount in the currency of payment + type: string + nativeExpectedAmount: + description: gross payment amount in the fiat currency + type: string + actualAmount: + description: net payment amount in the currency of payment + type: string + nativeActualAmount: + description: net payment amount in the fiat currency + type: string + paymentAddress: + type: string + description: address where funds are sent + errorCode: + type: string + description: array of strings displaying payment error. Possible values - 'unknown', 'negativeRate', 'payoutAddressIsNull', + 'paymentSubTotalIsLessThanMerchantTotalFee', 'totalBuyerWillPayIsNegativeOrZero', 'totalBuyerWillPayIsLessThanBuyerNetworkFee', + 'totalMerchantFeeRatioIsMoreThanMaximumRatioSetting', 'payoutAmountIsLessThanDust', 'currencyIsNotActive', + 'amountIsBelowOfConversionLimit', 'amountIsAboveOfConversionLimit', 'userLimitIsReached', 'notEnoughToActivateRippleAddress', + 'conversionPairDoesNotExist', 'addressIsNotValid', 'doesNotHaveCompletedKyc', 'unstoppableDomainNotFound', + 'unstoppableDomainNotFoundForCurrency', 'userWalletIsLocked', 'userWalletIsDeleted', 'largeWithdrawalRejected' + fees: + description: payment fees in cryptocurrency + $ref: ../../globalTypes/paymentFees-v2.yaml + nativeFees: + description: payment fees in fiat + $ref: ../../globalTypes/paymentFees-v2.yaml + payout: + type: object + description: payout details of the payment + properties: + scheduledAt: + type: string + description: date and time when the payout will be made + completedAt: + type: string + description: date and time when the payout has been completed + blockchainTx: + type: string + description: transaction id on the blockchain + spendRequestId: + type: string + description: id of the spend request in CoinPayments system for the payout with conversion + address: + type: string + description: address of the payout + walletId: + type: string + description: id of the wallet where payout address belongs + sentAt: + type: string + description: date and time when invoice was sent to the buyer + expectedExecutionDate: + type: string + description: date and time when invoice completion is expected + receivedBlockchainTx: + type: string + description: id of the payment transaction on the blockchain + currencySymbol: + type: string + description: symbol of the payout currency + currencyId: + type: string + description: id of the payout currency + displayValue: + type: string + description: payout amount as displayed in UI + value: + type: string + description: payout amount + valueAsDecimal: + type: number + description: payout amount in decimal format + nativePayout: + description: payout amount in fiat + type: string + refundEmail: + type: string + description: buyer's email that can be used for refund + state: + type: string + description: payment status. Possible values are - 'created', 'detected', 'pending', 'confirmed', 'scheduledForPayout', + 'completed', 'cancelledWaitingRefund', 'timedOutWaitingRefund', 'timedOutRefundProcessed', 'cancelledRefundProcessed' 'refunded' + isActive: + type: boolean + description: payment state + pendingAt: + type: string + description: date and time when payment is detected on the blockchain + confirmedAt: + type: string + description: date and time when payment receives first confirmation on the blockchain + completedAt: + type: string + description: date and time when payment receives all required confirmation on the blockchain + confirmations: + type: integer + description: number of confirmation payment received on the blockchain + requiredConfirmations: + type: integer + description: number of required confirmations for the payment to be considered completed + isLifeTimeFinished: + type: boolean + description: flag that indicates that invoice has not yet expired + hideShoppingCart: + type: boolean + description: a flag for hiding shopping cart in the checkout window. By default is 'false'. If set to 'true', shopping cart icon + in the checkout window is not displayed + + diff --git a/openapi/components/responses/invoices/invoiceByIdRes-v1.yaml b/openapi/components/responses/invoices/invoiceByIdRes-v1.yaml new file mode 100644 index 0000000..8ec40c9 --- /dev/null +++ b/openapi/components/responses/invoices/invoiceByIdRes-v1.yaml @@ -0,0 +1,504 @@ +type: object +description: Details of the invoice issued by the merchant +properties: + id: + type: string + description: unique invoice id with CoinPayments + invoiceId: + type: string + description: invoice id set by the merchant + invoiceIdSuffix: + type: string + description: the optional numeric suffix used when the invoice is emailed to multiple customers + created: + type: string + description: the timestamp when the invoice entity was created + invoiceDate: + type: string + description: the date of the invoice, either the system created date or custom date + specified by the merchant + dueDate: + type: string + description: optional due date of the invoice + confirmed: + type: string + description: the timestamp when the payment for the invoice is detected by CoinPayments on the blockchain + completed: + type: string + description: the timestamp when the invoice is paid out to the merchant + cancelled: + type: string + description: >- + the timestamp when the invoice is manually cancelled by the merchant + expires: + type: string + description: date and time when invoice will expire + currency: + type: object + description: currency in which invoice is issued + properties: + id: + type: string + description: currency id + symbol: + type: string + description: currency symbol + name: + type: string + description: currency name + token: + type: object + description: currency token in which invoice is issued + properties: + name: + type: string + description: token name + symbol: + type: string + description: token symbol + contractAddress: + type: string + description: token contract address + decimalPlaces: + type: integer + description: number of decimal places for displaying the invoice amount + format: int32 + logo: + $ref: ../../globalTypes/logo.yaml + decimalPlaces: + type: integer + format: int32 + merchant: + description: merchant details + type: object + properties: + id: + type: string + description: id of the merchant within CoinApyments system + name: + type: string + description: merchant's name + uboName: + type: string + description: merchant's UBO name + websiteUrl: + type: string + description: URL of the merchant's website + country: + type: string + description: merchant's country + logoUrl: + type: string + description: merchant's logo + email: + type: string + description: merchant's email + address: + type: string + description: merchants address + phone: + type: string + description: merchant's phone number + description: + type: string + description: description of the merchant + registrationNumber: + type: string + description: merchant's registration number + merchantOptions: + description: options of the merchant entity + type: object + properties: + showAddress: + type: boolean + description: flag that indicates whether merchant's address should be displayed on the invoice + showEmail: + type: boolean + description: flag that indicates whether merchant's email should be displayed on the invoice + showPhone: + type: boolean + description: flag that indicates whether merchant's phone number should be displayed on the invoice + showRegistrationNumber: + type: boolean + description: flag that indicates whether merchant's register number should be displayed on the invoice + additionalInfo: + type: string + description: flag that indicates whether merchant's additional information should be displayed on the invoice + buyer: + type: object + description: buyer details + properties: + companyName: + type: string + description: buyer's company name + name: + description: buyer's name + $ref: ../../globalTypes/fullName.yaml + emailAddress: + type: string + description: buyer's email + phoneNumber: + type: string + description: buyer's phone number + address: + $ref: ../../globalTypes/physicalAddress.yaml + hasData: + type: boolean + description: + type: string + description: description of the purchase + items: + type: array + description: array of items that a buyer intends to purchase from the merchant + items: + $ref: ../../schemas/invoices/items-v1.yaml + amount: + type: object + description: detailed amount of purchase with the breakdown of all fees + properties: + breakdown: + description: breakdown of invoice costs + type: object + properties: + subtotal: + description: sum of purchased items + $ref: ../../globalTypes/amount.yaml + shipping: + description: cost of shipping + $ref: ../../globalTypes/amount.yaml + handling: + description: cost of handling the order + $ref: ../../globalTypes/amount.yaml + taxTotal: + description: tax amount + $ref: ../../globalTypes/amount.yaml + discount: + description: discount amount for the whole purchase + $ref: ../../globalTypes/amount.yaml + currencyId: + type: string + description: original currency Id of the item + displayValue: + type: string + description: purchase value formatted for display (e.g 0.1234 BTC) + value: + type: string + description: this parameter represents the monetary value of purchase as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0 + valueAsDecimal: + type: string + description: the decimal value of purchase represents the monetary value with decimal precision derived from the value field, + which is the integer representation in the smallest unit of the currency or token. + shipping: + description: shipping details for the purchase + type: object + properties: + method: + type: string + description: method of shipping + companyName: + type: string + description: company name of the receiver + name: + $ref: ../../globalTypes/fullName.yaml + emailAddress: + type: string + description: receiver's email + phoneNumber: + type: string + description: receiver's phone number + address: + $ref: ../../globalTypes/physicalAddress.yaml + hasData: + type: boolean + customData: + type: string + description: custom data for receiver + status: + type: string + description: status of the invoice. Possible values - 'draft', 'scheduled', 'unpaid', 'pending', 'paid', 'completed', + 'cancelled', 'timedOut', 'deleted' + requireBuyerNameAndEmail: + type: boolean + description: a flag that indicates whether buyer's name and email are required to be shown on the invoice + buyerDataCollectionMessage: + type: string + description: indicates whether it is allowed to collect buyer's information + notes: + type: string + description: indicates whether merchant's notes are allowed for the invoice + notesToRecipient: + type: string + description: indicates whether merchant's notes for the buyer are allowed for the invoice + termsAndConditions: + type: string + description: indicates whether buyer must acknowledge terms and conditions for interraction with CoinPayments + emailDelivery: + type: object + description: email addresses to be used for invoice delivery + properties: + to: + type: string + description: to email address. The value can take multiple addresses separated by semicolons + cc: + type: string + description: field to add multiple recipients separated by semicolons + bcc: + type: string + description: bcc field similar to "cc" field except that other recipients won't be able to see that someone else has been sent a copy of the email + isEmailDelivery: + type: boolean + description: default value to be used for whitelabeling checkout flow. For invoice document delivery indicates if invoice will be email delivered + default: false + metadata: + type: object + description: invoice metadata + properties: + integration: + type: string + description: the integration from which the invoice was created + hostname: + type: string + description: name of the host where invoice is stored + poNumber: + type: string + description: merchant's number of the purchase order + payoutDetails: + type: object + description: details of the invoice payout + properties: + paidTransactions: + type: array + description: list of payment transactions for the invoice + items: + type: object + properties: + hash: + type: string + description: transaction hash + amount: + description: transaction amount + $ref: ../../globalTypes/amount.yaml + conversionId: + type: integer + description: id of the conversion transaction if payout mode is with conversion + format: int64 + paidDate: + type: string + description: date of payment + completedTxId: + type: string + description: id of the transaction that received enough confirmations on the blockchain + externalAddress: + type: string + description: address where payout is made, if payout mode is "To Address" + destinationCurrencyId: + type: string + description: id of the payout currency + expectedDisplayValue: + type: string + description: expected gross payout amount + sourceCurrencyId: + type: string + description: original currency of payment transaction + destinationWalletId: + type: string + description: id of the wallet for payout + isConversion: + type: boolean + description: if payout mode is with conversion + conversionProgress: + type: number + format: double + description: stage of the conversion at the payout + settlementModeErrorCode: + type: integer + format: int32 + description: error code for payout settlement + destinationAmount: + type: object + description: net payout amount + properties: + amount: + type: object + description: net payout amount in crypto + $ref: ../../globalTypes/amount.yaml + nativeAmount: + type: object + description: net payout amount in fiat + $ref: ../../globalTypes/amount.yaml + receivedBlockchainTxId: + type: string + description: id of the payment transaction on the blockchain + items: + type: array + description: invoice payout details + items: + type: object + properties: + currency: + type: object + description: currency of payout + $ref: ../../globalTypes/currency.yaml + merchantFees: + type: object + description: fees paid by the merchant + properties: + transactionFee: + description: CoinPayments fee + $ref: ../../globalTypes/amount.yaml + networkFee: + description: blockchain fee + $ref: ../../globalTypes/amount.yaml + conversionFee: + description: fee for conversion in case payout mode is with conversion + $ref: ../../globalTypes/amount.yaml + payoutAmount: + description: amount to be paid out to the merchant in crypto + $ref: ../../globalTypes/amount.yaml + payoutAmountInInvoiceCurrency: + description: amount to be paid out to the merchant in fiat + $ref: ../../globalTypes/amount.yaml + merchantPayoutAddress: + type: string + description: merchant's address where funds to be paid out + created: + type: string + description: date and time when payout transaction is created by CoinPayments + sent: + type: string + description: date and time when payout transaction is sent to the merchant by CoinPayments + expected: + type: string + description: date and time when payout transaction is expected to be delivered to the merchant + confirmed: + type: string + description: date and time when payout transaction get on the blockchain in case payout mode is with conversion or to an external address + state: + type: string + description: status of the payout, possible values are - 'scheduled', 'sending', 'sent', 'confirmed', + 'waitingConversion', 'failed', 'waitingInternalReceive', 'waitingExternalConfirm' + paging: + $ref: ../../globalTypes/paging.yaml + payments: + type: array + description: payment details in all currencies supported by the merchant + items: + type: object + description: payment details + properties: + expectedAmount: + description: gross payment amount in the currency of payment + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + nativeExpectedAmount: + description: gross payment amount in the fiat currency + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + actualAmount: + description: net payment amount in the currency of payment + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + nativeActualAmount: + description: net payment amount in the fiat currency + paymentAddress: + type: string + description: address where funds are sent + errorCode: + type: string + description: payment error. Possible values - 'unknown', 'negativeRate', 'payoutAddressIsNull', + 'paymentSubTotalIsLessThanMerchantTotalFee', 'totalBuyerWillPayIsNegativeOrZero', 'totalBuyerWillPayIsLessThanBuyerNetworkFee', + 'totalMerchantFeeRatioIsMoreThanMaximumRatioSetting', 'payoutAmountIsLessThanDust', 'currencyIsNotActive', + 'amountIsBelowOfConversionLimit', 'amountIsAboveOfConversionLimit', 'userLimitIsReached', 'notEnoughToActivateRippleAddress', + 'conversionPairDoesNotExist', 'addressIsNotValid', 'doesNotHaveCompletedKyc', 'unstoppableDomainNotFound', + 'unstoppableDomainNotFoundForCurrency', 'userWalletIsLocked', 'userWalletIsDeleted', 'largeWithdrawalRejected' + fees: + description: payment fees in cryptocurrency + $ref: ../../globalTypes/paymentFees-v1.yaml + nativeFees: + description: payment fees in fiat + $ref: ../../globalTypes/paymentFees-v1.yaml + payout: + type: object + required: + - currencyId + - value + description: payout details of the payment + properties: + scheduledAt: + type: string + description: date and time when the payout will be made + completedAt: + type: string + description: date and time when the payout has been completed + blockchainTx: + type: string + description: transaction id on the blockchain + spendRequestId: + type: string + description: id of the spend request in CoinPayments system for the payout with conversion + address: + type: string + description: address of the payout + walletId: + type: string + description: id of the wallet where payout address belongs + sentAt: + type: string + description: date and time when received funds are sent to the merchant's balance + expectedExecutionDate: + type: string + description: date and time when payout is expected + receivedBlockchainTx: + type: string + description: id of the received payment transaction + currencySymbol: + type: string + description: symbol of the payout currency + currencyId: + type: string + description: id of the payout currency + displayValue: + type: string + description: payout amount as displayed in UI + value: + type: string + description: payout amount + valueAsDecimal: + type: number + description: payout amount in decimal format + nativePayout: + description: payout amount in fiat + $ref: ../../globalTypes/paymentAmountInvoiceRes.yaml + refundEmail: + type: string + description: buyer's email that can be used for refund + state: + type: string + description: payment status. Possible values are - 'created', 'detected', 'pending', 'confirmed', 'scheduledForPayout', + 'completed', 'cancelled', 'timedOut', 'refunded' + isActive: + type: boolean + description: payment state + pendingAt: + type: string + description: date and time when payment is detected on the blockchain + confirmedAt: + type: string + description: date and time when payment receives first confirmation on the blockchain + completedAt: + type: string + description: date and time when payment receives all required confirmation on the blockchain + confirmations: + type: integer + description: number of confirmation payment received on the blockchain + requiredConfirmations: + type: integer + description: number of required confirmations for the payment to be considered completed + isLifeTimeFinished: + type: boolean + description: a flag indicating whether invoice has not expired yet + hideShoppingCart: + type: boolean + description: a flag indicating whether shopping cart symbol must be hidden from the checkout page + + diff --git a/openapi/components/responses/invoices/invoiceByIdRes-v2.yaml b/openapi/components/responses/invoices/invoiceByIdRes-v2.yaml new file mode 100644 index 0000000..5d7f001 --- /dev/null +++ b/openapi/components/responses/invoices/invoiceByIdRes-v2.yaml @@ -0,0 +1,485 @@ +type: object +properties: + id: + type: string + description: unique invoice id with CoinPayments + invoiceId: + type: string + description: invoice id set by the merchant + invoiceIdSuffix: + type: string + description: the optional numeric suffix used when the invoice is emailed to multiple customers + created: + type: string + description: the timestamp when the invoice entity was created + invoiceDate: + type: string + description: the date of the invoice, either the system created date or custom date + specified by the merchant + dueDate: + type: string + description: optional due date of the invoice + confirmed: + type: string + description: the timestamp when the payment for the invoice is detected by CoinPayments on the blockchain + completed: + type: string + description: the timestamp when the invoice is paid out to the merchant + cancelled: + type: string + description: >- + the timestamp when the invoice is manually cancelled by the merchant + expires: + type: string + description: date and time when invoice will expire + currency: + type: object + description: currency in which invoice is issued + properties: + id: + type: string + description: currency id + symbol: + type: string + description: currency symbol + name: + type: string + description: currency name + token: + type: object + description: currency token in which invoice is issued + properties: + name: + type: string + description: token name + symbol: + type: string + description: token symbol + contractAddress: + type: string + description: token contract address + decimalPlaces: + type: integer + description: number of decimal places for displaying the invoice amount + format: int32 + logo: + $ref: ../../globalTypes/logo.yaml + decimalPlaces: + type: integer + format: int32 + merchant: + type: object + description: merchant details + properties: + id: + type: string + description: id of the merchant within CoinApyments system + name: + type: string + description: merchant's name + uboName: + type: string + description: merchant's UBO name + websiteUrl: + type: string + description: URL of the merchant's website + country: + type: string + description: merchant's country + logoUrl: + type: string + description: merchant's logo + email: + type: string + description: merchant's email + address: + type: string + description: merchants address + phone: + type: string + description: merchant's phone number + description: + type: string + description: description of the merchant + registrationNumber: + type: string + description: merchant's registration number + merchantOptions: + description: options of the merchant entity + type: object + properties: + showAddress: + type: boolean + description: flag that indicates whether merchant's address should be displayed on the invoice + showEmail: + type: boolean + description: flag that indicates whether merchant's email should be displayed on the invoice + showPhone: + type: boolean + description: flag that indicates whether merchant's phone number should be displayed on the invoice + showRegistrationNumber: + type: boolean + description: flag that indicates whether merchant's register number should be displayed on the invoice + additionalInfo: + type: string + description: flag that indicates whether merchant's additional information should be displayed on the invoice + buyer: + type: object + description: buyer details + properties: + companyName: + type: string + description: buyer's company name + name: + description: buyer's name + $ref: ../../globalTypes/fullName.yaml + emailAddress: + type: string + description: buyer's email + phoneNumber: + type: string + description: buyer's phone number + address: + $ref: ../../globalTypes/physicalAddress.yaml + hasData: + type: boolean + description: + type: string + description: the purchase description + items: + type: array + description: array of items that a buyer intends to purchase from the merchant + items: + $ref: ../../schemas/invoices/items-v2.yaml + amount: + type: object + required: + - breakdown + - total + description: detailed amount of purchase with the breakdown of all fees + properties: + breakdown: + type: object + required: + - subtotal + properties: + subtotal: + description: sum of purchased items + type: string + shipping: + description: cost of shipping + type: string + handling: + description: service cost for processing order + type: string + taxTotal: + description: tax cost + type: string + discount: + description: discount amount + type: string + total: + description: total amount of the invoice + type: string + shipping: + description: shipping address + $ref: ../../globalTypes/physicalAddress.yaml + customData: + type: object + description: any custom data merchant wishes to attach to the invoice that may be further used for custom merchant's purposes. Not visible on UI for buyers + status: + type: string + description: status of the invoice. Possible values - 'draft', 'scheduled', 'unpaid', 'pending', 'paid', 'completed', + 'cancelled', 'timedOut', 'deleted' + requireBuyerNameAndEmail: + type: boolean + description: flag indicating whether a buyer name and email are required, they will be requested at checkout if not provider by the caller. + buyerDataCollectionMessage: + type: string + description: the message to display when collecting buyer user data + notes: + type: string + description: notes added to the invoice by the merchant + notesToRecipient: + type: string + description: notes added to the invoice by the merchant for the buyer + termsAndConditions: + type: string + description: any terms and conditions, e.g. a cancellation policy + emailDelivery: + type: object + description: email addresses to be used for invoice delivery + properties: + to: + type: string + description: to email address. The value can take multiple addresses separated by semicolons + cc: + type: string + description: field to add multiple recipients separated by semicolons + bcc: + type: string + description: bcc field similar to "cc" field except that other recipients won't be able to see that someone else has been sent a copy of the email + isEmailDelivery: + type: boolean + description: indicates if invoice is to be delivered by email + metadata: + type: object + description: invoice metadata + properties: + integration: + type: string + description: the integration from which the invoice was created + hostName: + type: string + description: name of the host + poNumber: + type: string + description: optional Purchase order number on the integration API + payoutDetails: + type: object + description: details of the merchant payout settings for the payment + properties: + paidTransactions: + type: array + description: list of payment transactions for the invoice + items: + type: object + properties: + hash: + type: string + description: transaction hash + amount: + description: transaction amount + $ref: ../../globalTypes/amount.yaml + conversionId: + type: integer + description: id of the conversion transaction if payout mode is with conversion + format: int64 + paidDate: + type: string + description: date of payment + completedTxId: + type: string + description: id of the transaction that received enough confirmations on the blockchain + externalAddress: + type: string + description: address where payout is made, if payout mode is "To Address" + destinationCurrencyId: + type: string + description: id of the payout currency + expectedDisplayValue: + type: string + description: expected gross payout amount + sourceCurrencyId: + type: string + description: original currency of payment transaction + destinationWalletId: + type: string + description: id of the wallet for payout + isConversion: + type: boolean + description: if payout mode is with conversion + conversionProgress: + type: number + format: double + description: stage of the conversion at the payout + settlementModeErrorCode: + type: integer + format: int32 + description: error code for payout settlement + destinationAmount: + type: object + description: net payout amount + properties: + amount: + type: object + description: net payout amount in crypto + $ref: ../../globalTypes/amount.yaml + nativeAmount: + type: object + description: net payout amount in fiat + $ref: ../../globalTypes/amount.yaml + receivedBlockchainTxId: + type: string + description: id of the payment transaction on the blockchain + items: + type: array + description: invoice payout details + items: + type: object + properties: + currency: + type: object + description: currency of payout + $ref: ../../globalTypes/currency.yaml + merchantFees: + type: object + description: fees paid by the merchant + properties: + transactionFee: + description: CoinPayments fee + $ref: ../../globalTypes/amount.yaml + networkFee: + description: blockchain fee + $ref: ../../globalTypes/amount.yaml + conversionFee: + description: fee for conversion in case payout mode is with conversion + $ref: ../../globalTypes/amount.yaml + payoutAmount: + description: amount to be paid out to the merchant in crypto + $ref: ../../globalTypes/amount.yaml + payoutAmountInInvoiceCurrency: + description: amount to be paid out to the merchant in fiat + $ref: ../../globalTypes/amount.yaml + merchantPayoutAddress: + type: string + description: merchant's address where funds to be paid out + created: + type: string + description: date and time when payout transaction is created by CoinPayments + sent: + type: string + description: date and time when payout transaction is sent to the merchant by CoinPayments + expected: + type: string + description: date and time when payout transaction is expected to be delivered to the merchant + confirmed: + type: string + description: date and time when payout transaction get on the blockchain in case payout mode is with conversion or to an external address + state: + type: string + description: status of the payout, possible values are - 'scheduled', 'sending', 'sent', 'confirmed', + 'waitingConversion', 'failed', 'waitingInternalReceive', 'waitingExternalConfirm' + paging: + $ref: ../../globalTypes/paging.yaml + payments: + type: array + description: payment details in all currencies supported by the merchant + items: + type: object + description: payment details + properties: + paymentCurrencyId: + type: string + description: id of the payment currency + paymentCurrencySymbol: + type: string + description: symbol of the payment currency + nativeCurrencyId: + type: string + description: id of the invoice currency + nativeCurrencySymbol: + type: string + description: symbol of the invoice currency + expectedAmount: + description: gross payment amount in the currency of payment + type: string + nativeExpectedAmount: + description: gross payment amount in the fiat currency + type: string + actualAmount: + description: net payment amount in the currency of payment + type: string + nativeActualAmount: + description: net payment amount in the fiat currency + type: string + paymentAddress: + type: string + description: address where funds are sent + errorCode: + type: string + description: array of strings displaying payment error. Possible values - 'unknown', 'negativeRate', 'payoutAddressIsNull', + 'paymentSubTotalIsLessThanMerchantTotalFee', 'totalBuyerWillPayIsNegativeOrZero', 'totalBuyerWillPayIsLessThanBuyerNetworkFee', + 'totalMerchantFeeRatioIsMoreThanMaximumRatioSetting', 'payoutAmountIsLessThanDust', 'currencyIsNotActive', + 'amountIsBelowOfConversionLimit', 'amountIsAboveOfConversionLimit', 'userLimitIsReached', 'notEnoughToActivateRippleAddress', + 'conversionPairDoesNotExist', 'addressIsNotValid', 'doesNotHaveCompletedKyc', 'unstoppableDomainNotFound', + 'unstoppableDomainNotFoundForCurrency', 'userWalletIsLocked', 'userWalletIsDeleted', 'largeWithdrawalRejected' + fees: + description: payment fees in cryptocurrency + $ref: ../../globalTypes/paymentFees-v2.yaml + nativeFees: + description: payment fees in fiat + $ref: ../../globalTypes/paymentFees-v2.yaml + payout: + type: object + description: payout details of the payment + properties: + scheduledAt: + type: string + description: date and time when the payout will be made + completedAt: + type: string + description: date and time when the payout has been completed + blockchainTx: + type: string + description: transaction id on the blockchain + spendRequestId: + type: string + description: id of the spend request in CoinPayments system for the payout with conversion + address: + type: string + description: address of the payout + walletId: + type: string + description: id of the wallet where payout address belongs + sentAt: + type: string + description: date and time when invoice was sent to the buyer + expectedExecutionDate: + type: string + description: date and time when invoice completion is expected + receivedBlockchainTx: + type: string + description: id of the payment transaction on the blockchain + currencySymbol: + type: string + description: symbol of the payout currency + currencyId: + type: string + description: id of the payout currency + displayValue: + type: string + description: payout amount as displayed in UI + value: + type: string + description: payout amount + valueAsDecimal: + type: number + description: payout amount in decimal format + nativePayout: + description: payout amount in fiat + type: string + refundEmail: + type: string + description: buyer's email that can be used for refund + state: + type: string + description: payment status. Possible values are - 'created', 'detected', 'pending', 'confirmed', 'scheduledForPayout', + 'completed', 'cancelledWaitingRefund', 'timedOutWaitingRefund', 'timedOutRefundProcessed', 'cancelledRefundProcessed' 'refunded' + isActive: + type: boolean + description: payment state + pendingAt: + type: string + description: date and time when payment is detected on the blockchain + confirmedAt: + type: string + description: date and time when payment receives first confirmation on the blockchain + completedAt: + type: string + description: date and time when payment receives all required confirmation on the blockchain + confirmations: + type: integer + description: number of confirmation payment received on the blockchain + requiredConfirmations: + type: integer + description: number of required confirmations for the payment to be considered completed + isLifeTimeFinished: + type: boolean + description: flag that indicates that invoice has not yet expired + hideShoppingCart: + type: boolean + description: a flag for hiding shopping cart in the checkout window. By default is 'false'. If set to 'true', shopping cart icon + in the checkout window is not displayed + + diff --git a/openapi/components/responses/invoices/invoicePaymentCur-v1.yaml b/openapi/components/responses/invoices/invoicePaymentCur-v1.yaml new file mode 100644 index 0000000..3b07ee4 --- /dev/null +++ b/openapi/components/responses/invoices/invoicePaymentCur-v1.yaml @@ -0,0 +1,29 @@ +type: object +properties: + currency: + type: object + description: details of the cryptocurrency that can be applied for payment + $ref: ../../globalTypes/currency.yaml + isDisabled: + type: boolean + description: flag indicating whether this currency is currently unavailable (e.g. node or services is down) + amount: + type: object + description: due amount of the invoice in the cryptocurrency + $ref: ../../globalTypes/invoicePaymentAmountDue.yaml + nativePreferredAmount: + type: object + description: due amount of the invoice in the native fiat currency + $ref: ../../globalTypes/invoicePaymentAmountDue.yaml + approximateNetworkAmount: + type: object + description: approximate network fee amount in the cryptocurrency + $ref: ../../globalTypes/fees.yaml + approximateNetworkInNativeCurrencyAmount: + type: object + description: approximate network fee amount in the native fiat currency + $ref: ../../globalTypes/fees.yaml + remainingAmount: + type: object + description: remaining amount to be paid in case partial payment of the invoice has already been made + $ref: ../../globalTypes/fees.yaml \ No newline at end of file diff --git a/openapi/components/responses/invoices/invoicePaymentCur-v2.yaml b/openapi/components/responses/invoices/invoicePaymentCur-v2.yaml new file mode 100644 index 0000000..732484d --- /dev/null +++ b/openapi/components/responses/invoices/invoicePaymentCur-v2.yaml @@ -0,0 +1,18 @@ +type: object +properties: + currency: + type: object + description: details of the cryptocurrency that can be applied for payment + $ref: ../../globalTypes/currency.yaml + isDisabled: + type: boolean + description: flag indicating whether this currency is currently unavailable (e.g. node or services is down) + amount: + type: string + description: due amount of the invoice in the cryptocurrency + approximateNetworkAmount: + type: string + description: approximate network fee amount in the cryptocurrency + remainingAmount: + type: string + description: remaining amount to be paid in case partial payment of the invoice has already been made \ No newline at end of file diff --git a/openapi/components/responses/invoices/invoices-v1.yaml b/openapi/components/responses/invoices/invoices-v1.yaml new file mode 100644 index 0000000..cf8237b --- /dev/null +++ b/openapi/components/responses/invoices/invoices-v1.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: ./getInvoicesRes-v1.yaml \ No newline at end of file diff --git a/openapi/components/responses/invoices/invoices-v2.yaml b/openapi/components/responses/invoices/invoices-v2.yaml new file mode 100644 index 0000000..d5bb474 --- /dev/null +++ b/openapi/components/responses/invoices/invoices-v2.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: ./getInvoicesRes-v2.yaml \ No newline at end of file diff --git a/openapi/components/responses/invoices/listOfInvoices.yaml b/openapi/components/responses/invoices/listOfInvoices.yaml new file mode 100644 index 0000000..2d9b8c8 --- /dev/null +++ b/openapi/components/responses/invoices/listOfInvoices.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: ../newWallet.yaml diff --git a/openapi/components/responses/rates/rateItemRes-v1.yaml b/openapi/components/responses/rates/rateItemRes-v1.yaml new file mode 100644 index 0000000..1678f9b --- /dev/null +++ b/openapi/components/responses/rates/rateItemRes-v1.yaml @@ -0,0 +1,22 @@ +type: object +description: Conversion rate between two currencies +properties: + baseCurrencyId: + type: integer + description: the currency code of the source/base currency + example: 1 + baseToken: + type: string + description: the contract address of the source/base token on the base currency platform + quoteCurrencyId: + type: integer + description: the currency code of the target/quoted currency + quoteToken: + type: string + description: the contract address of the target/quoted token on the quoted currency platform + rate: + type: string + description: the conversion rate to convert from BaseCurrencyId into QuoteCurrencyId + + + diff --git a/openapi/components/responses/rates/rateItemRes-v2.yaml b/openapi/components/responses/rates/rateItemRes-v2.yaml new file mode 100644 index 0000000..2a95f75 --- /dev/null +++ b/openapi/components/responses/rates/rateItemRes-v2.yaml @@ -0,0 +1,21 @@ +type: object +description: Conversion rate between two currencies +properties: + baseCurrencyId: + type: string + description: the currency code of the source/base currency + example: '1' + baseSymbol: + type: string + description: the currency symbol of the source/base currency + quoteCurrencyId: + type: string + description: the currency id of the target/quoted currency + quoteSymbol: + type: string + description: the currency symbol of the target/quoted currency + rate: + type: string + description: the conversion rate to convert from BaseCurrencyId into QuoteCurrencyId + + diff --git a/openapi/components/responses/rates/ratesRes-v1.yaml b/openapi/components/responses/rates/ratesRes-v1.yaml new file mode 100644 index 0000000..e185640 --- /dev/null +++ b/openapi/components/responses/rates/ratesRes-v1.yaml @@ -0,0 +1,6 @@ +type: object +properties: + items: + type: array + items: + $ref: ./rateItemRes-v1.yaml \ No newline at end of file diff --git a/openapi/components/responses/rates/ratesRes-v2.yaml b/openapi/components/responses/rates/ratesRes-v2.yaml new file mode 100644 index 0000000..b82f2cf --- /dev/null +++ b/openapi/components/responses/rates/ratesRes-v2.yaml @@ -0,0 +1,6 @@ +type: object +properties: + items: + type: array + items: + $ref: ./rateItemRes-v2.yaml \ No newline at end of file diff --git a/openapi/components/responses/wallets/SpendRequestConfirmationSuccess-v1.yaml b/openapi/components/responses/wallets/SpendRequestConfirmationSuccess-v1.yaml new file mode 100644 index 0000000..0ec6e0c --- /dev/null +++ b/openapi/components/responses/wallets/SpendRequestConfirmationSuccess-v1.yaml @@ -0,0 +1,56 @@ +type: object +properties: + spendRequestId: + description: Id of spend request + type: string + example: '02741e6d-f5c5-43bb-8f08-9a523173cb42' + fromWalletId: + description: Id of wallet from where the amount is to be deducted + type: string + example: 'e0ac29cd-d2d2-4f27-8196-236fc75a1e31' + toAddress: + description: Address where the amount is to be transferred + type: string + example: 'mmbYp8ziTBXxPJKM7ai74poX33fPqxwMWK' + fromContractAddress: + description: Address of the contract (if the withdrawal is from a contract wallet) + type: string + fromCurrencyId: + description: Id of the currency of withdrawal + type: integer + example: 1002 + toCurrencyId: + description: Id of the currency of receipt + type: integer + example: 1002 + blockchainFee: + description: Fee to be paid to the blockchain for the transfer + type: number + example: 0.0001 + coinpaymentsFee: + description: CoinPayments network fee + type: number + example: 0.0001 + fromAmount: + description: Amount to be spent + type: number + example: 2 + toAmount: + description: Amount to be transferred to the destination address + type: number + example: 2 + memo: + description: Optional user-defined note for the spend + type: string + example: 'This is a memo' + toContractAddress: + description: Contract address of the destination currency for conversions (if the conversion pertains tokens) + type: string + walletToPayFeeFrom: + type: string + description: if provided, this wallet will be used to pay fees instead of the primary wallet + + + + + diff --git a/openapi/components/responses/wallets/SpendRequestConfirmationSuccess-v2.yaml b/openapi/components/responses/wallets/SpendRequestConfirmationSuccess-v2.yaml new file mode 100644 index 0000000..5e0d084 --- /dev/null +++ b/openapi/components/responses/wallets/SpendRequestConfirmationSuccess-v2.yaml @@ -0,0 +1,56 @@ +type: object +properties: + spendRequestId: + description: Id of spend request + type: string + example: '02741e6d-f5c5-43bb-8f08-9a523173cb42' + fromWalletId: + description: Id of wallet from where the amount is to be deducted + type: string + example: 'e0ac29cd-d2d2-4f27-8196-236fc75a1e31' + toAddress: + description: Address where the amount is to be transferred + type: string + example: 'mmbYp8ziTBXxPJKM7ai74poX33fPqxwMWK' + fromCurrencyId: + description: Id of the currency of withdrawal + type: string + example: '1002' + fromCurrencySymbol: + type: string + description: symbol of the currency of withdrawal + fromAmount: + description: Amount to be spent + type: string + example: '2' + toCurrencyId: + description: Id of the currency of receipt + type: string + example: '1002' + toCurrencySymbol: + type: string + description: symbol of the currency of receipt + toAmount: + description: Amount to be transferred to the destination address + type: string + example: '2' + blockchainFee: + description: Fee to be paid to the blockchain for the transfer + type: string + example: '0.0001' + coinpaymentsFee: + description: CoinPayments network fee + type: string + example: '0.0001' + memo: + description: Optional user-defined note for the spend + type: string + example: 'This is a memo' + walletToPayFeeFrom: + type: string + description: if provided, this wallet will be used to pay fees instead of the primary wallet + + + + + diff --git a/openapi/components/responses/wallets/SpendRequestSuccess.yaml b/openapi/components/responses/wallets/SpendRequestSuccess.yaml new file mode 100644 index 0000000..358ade3 --- /dev/null +++ b/openapi/components/responses/wallets/SpendRequestSuccess.yaml @@ -0,0 +1,7 @@ +type: object +properties: + spendRequestId: + description: Id of spend request + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + diff --git a/openapi/components/responses/wallets/addressByIdRes.yaml b/openapi/components/responses/wallets/addressByIdRes.yaml new file mode 100644 index 0000000..583f7b1 --- /dev/null +++ b/openapi/components/responses/wallets/addressByIdRes.yaml @@ -0,0 +1,20 @@ +type: object +properties: + addressId: + description: Id of address + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + label: + description: name of the address + type: string + address: + description: merchant address + type: string + notificationUrl: + description: url for sending webhooks for the address + type: string + rentedTill: + description: date and time until account-based address is in lease by the merchant. If no new deposit is made to the + address until the indicated date and time, the address returns to the pool of CoinPayments addresses (applied for + temporary account-based addresses) + type: string diff --git a/openapi/components/responses/wallets/addressRes.yaml b/openapi/components/responses/wallets/addressRes.yaml new file mode 100644 index 0000000..79cd056 --- /dev/null +++ b/openapi/components/responses/wallets/addressRes.yaml @@ -0,0 +1,16 @@ +type: object +properties: + addressId: + description: Id of newly created address + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + networkAddress: + description: the network address that was created. + type: string + example: LNUPQLeQFfF67RtH1dqFBiwJhYBNZCW7pm + rentedTill: + description: date and time until account-based address is in lease by the merchant. If no new deposit is made to the + address until the indicated date and time, the address returns to the pool of CoinPayments addresses (applied for + temporary account-based addresses) + type: string + example: '2024-08-14T16:48:38' diff --git a/openapi/components/responses/wallets/consolidationRes.yaml b/openapi/components/responses/wallets/consolidationRes.yaml new file mode 100644 index 0000000..7bcab2a --- /dev/null +++ b/openapi/components/responses/wallets/consolidationRes.yaml @@ -0,0 +1,54 @@ +type: object +description: Information about merchant wallet consolidation (sweeping funds from addresses to the main wallet balance) +properties: + newReceivedInternal: + description: amount of funds received as an internal transfer + type: string + newReceivedExternal: + description: amount of funds received as an external transfer + type: string + activationFee: + description: fee for activating new permanent account-based addresses within the wallet + type: string + transferFee: + description: fee for transfer funds from permanent account-based addresses within the wallet to the wallet balance + type: string + totalFee: + description: total fee for sweeping funds from permanent account-based addresses within the wallet to the wallet balance + type: string + available: + description: amount of funds that will be transferred to the wallet balance after deduction of all fees + type: string + addresses: + type: array + description: list of addresses participating in funds sweep with their details + items: + type: object + description: Information about a single address participating in consolidation of funds within merchant wallet + (sending funds to the main wallet) + properties: + newReceivedInternal: + description: amount of funds received as an internal transfer to the address + type: string + newReceivedExternal: + description: amount of funds received as an external transfer to the address + type: string + activationFee: + description: fee for activating the address + type: string + transferFee: + description: fee for transfer funds from this address to the wallet balance + type: string + totalFee: + description: total fee for sweeping funds from this addresses to the wallet balance + type: string + available: + description: amount of funds that will be transferred to the wallet balance after deduction of all fees from + the address balance + type: string + address: + description: address from which funds are swept to the wallet balance + type: string + addressId: + description: ID of the address from which funds are swept to the wallet balance within CPS + type: string diff --git a/openapi/components/responses/wallets/consolidationResWallets.yaml b/openapi/components/responses/wallets/consolidationResWallets.yaml new file mode 100644 index 0000000..0f74b26 --- /dev/null +++ b/openapi/components/responses/wallets/consolidationResWallets.yaml @@ -0,0 +1,57 @@ +type: object +description: Information about merchant wallet consolidation (sweeping funds from addresses to the main wallet balance) +properties: + newReceivedInternal: + description: amount of funds received as an internal transfer + type: string + newReceivedExternal: + description: amount of funds received as an external transfer + type: string + activationFee: + description: fee for activating new permanent account-based addresses within the wallet + type: string + transferFee: + description: fee for transfer funds from permanent account-based addresses within the wallet to the wallet balance + type: string + totalFee: + description: total fee for sweeping funds from permanent account-based addresses within the wallet to the wallet balance + type: string + available: + description: amount of funds that will be transferred to the wallet balance after deduction of all fees + type: string + addresses: + type: array + description: list of addresses participating in funds sweep with their details + items: + type: object + description: Information about a single address participating in consolidation of funds within merchant wallet + (sending funds to the main wallet) + properties: + newReceivedInternal: + description: amount of funds received as an internal transfer to the address + type: string + newReceivedExternal: + description: amount of funds received as an external transfer to the address + type: string + activationFee: + description: fee for activating the address + type: string + transferFee: + description: fee for transfer funds from this address to the wallet balance + type: string + totalFee: + description: total fee for sweeping funds from this addresses to the wallet balance + type: string + available: + description: amount of funds that will be transferred to the wallet balance after deduction of all fees from + the address balance + type: string + address: + description: address from which funds are swept to the wallet balance + type: string + addressId: + description: ID of the address from which funds are swept to the wallet balance within CPS + type: string + walletId: + description: ID of the wallet where belongs the address from which funds are swept to the wallet balance within CPS + type: string diff --git a/openapi/components/responses/wallets/list-of-addresses.yaml b/openapi/components/responses/wallets/list-of-addresses.yaml new file mode 100644 index 0000000..afba435 --- /dev/null +++ b/openapi/components/responses/wallets/list-of-addresses.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: ../../globalTypes/walletAddress.yaml diff --git a/openapi/components/responses/wallets/wallet-webhook-payload.yaml b/openapi/components/responses/wallets/wallet-webhook-payload.yaml new file mode 100644 index 0000000..60c5478 --- /dev/null +++ b/openapi/components/responses/wallets/wallet-webhook-payload.yaml @@ -0,0 +1,77 @@ +type: object +properties: + walletId: + description: wallet id + type: string + example: '4ca18e8e-915b-4a69-a17a-0b0b666858a7' + address: + description: wallet address involved into the transaction performance + type: string + example: 'myGTmrMtU6vUULkYRCDxJMggF7egsXhcTi' + transactionId: + description: id of the transaction that is being executed + type: string + example: 'cb44e78f-a97b-44b5-a23d-1e3b025aab47' + txHash: + type: string + description: hash of the transaction that is being executed + example: '9d9dd1f6f4a62388797e6beeb76c1a3c34d41942303ce6fb49177d3c88a74d11' + spendRequestId: + type: string + description: id of the withdrawal spend request. Is applied only for withdrawal and conversion transactions + example: '448c1624-98e7-43c9-85f4-75ed0c97a8bb' + transactionType: + type: string + description: type of the transaction that is being executed. Possible values are InternalReceive, UtxoExternalReceive, + AccountBasedExternalReceive, InternalSpend, ExternalSpend, SameUserReceive, AccountBasedExternalTokenReceive, + AccountBasedTokenSpend + example: 'ExternalSpend' + amount: + type: integer + description: net transaction amount in crypto + symbol: + type: string + description: currency of the transaction + coinPaymentsFee: + type: integer + description: transaction fee charged by CoinPayments + coinPaymentsFeeSymbol: + type: string + description: currency of the transaction fee charged by CoinPayments in crypto + blockchainFee: + type: string + description: network fee in crypto + blockchainFeeSymbol: + type: string + description: currency of the network fee + totalAmount: + type: string + description: gross transaction amount in crypto + totalAmountSymbol: + type: string + description: currency of the gross transaction amount + nativeAmount: + type: integer + description: net transaction amount in fiat + coinPaymentsFeeNativeAmount: + type: string + description: CP fee amount in fiat + blockchainFeeNativeAmount: + type: string + description: network fee amount in fiat + totalNativeAmount: + type: string + description: gross transaction amount in fiat + nativeSymbol: + type: string + description: fiat currency of the transaction amount and fees + confirmations: + type: integer + description: amount of confirmations gathered by the transaction on chain. Deposits require a + specific number of blockchain confirmations to release the funds for payout. Crediting funds to the customer prior + to receiving the full number of confirmations shall be done at merchant's own risk. + requiredConfirmations: + type: integer + description: amount of confirmations required for the transaction on chain to be considered completed. Deposits require a + specific number of blockchain confirmations to release the funds for payout. Crediting funds to the customer prior + to receiving the full number of confirmations shall be done at merchant's own risk. diff --git a/openapi/components/responses/webhooks/updateWebhookRes.yaml b/openapi/components/responses/webhooks/updateWebhookRes.yaml new file mode 100644 index 0000000..7c801cb --- /dev/null +++ b/openapi/components/responses/webhooks/updateWebhookRes.yaml @@ -0,0 +1,41 @@ +type: object +properties: + id: + description: callback address id + $ref: ../../globalTypes/address.yaml + clientId: + description: client Id + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + created: + description: date and time of creating the callback address + type: string + example: '2022-10-11T14:34:32.945Z' + currencyId: + $ref: ../../globalTypes/currencyId.yaml + contractAddress: + description: 'the address of the contract if this money object represents an ERC20 or similar token value' + $ref: ../../globalTypes/address.yaml + label: + description: label for callback address + type: string + example: 'John Doe`s address' + updatedAt: + description: date of last time the wallet data was modified by the user + type: string + example: '2022-10-05T06:05:07.520Z' +# depositAddress: +# description: address to deposit funds into the wallet +# type: string +# example: 'Asaiuqhdaknxyuiw21w2w2223' +# walletStatus: +# description: status of the wallet in the system +# type: string +# example: unknown +# canCreateAddress: +# description: indicates whether the wallet can create an address +# type: boolean +# example: true + webhook: + $ref: ../../schemas/webhooks/webhookSchema.yaml + diff --git a/openapi/components/schemas/Email.yaml b/openapi/components/schemas/Email.yaml new file mode 100644 index 0000000..55801ff --- /dev/null +++ b/openapi/components/schemas/Email.yaml @@ -0,0 +1,4 @@ +description: User email address +type: string +format: test +example: john.smith@example.com diff --git a/openapi/components/schemas/Problem.yaml b/openapi/components/schemas/Problem.yaml new file mode 100644 index 0000000..9dccb03 --- /dev/null +++ b/openapi/components/schemas/Problem.yaml @@ -0,0 +1,39 @@ +type: object +additionalProperties: true +minProperties: 1 +description: >- + The Problem Details JSON Object [[RFC7807](https://tools.ietf.org/html/rfc7807)]. +properties: + type: + type: string + description: >- + A URI reference [[RFC3986](https://tools.ietf.org/html/rfc3986)] that identifies the problem type. + It should provide human-readable documentation for the problem type. + When this member is not present, its value is assumed to be "about:blank". + format: uri + title: + type: string + description: >- + A short, human-readable summary of the problem type. + It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. + status: + type: integer + description: The HTTP status code. + minimum: 400 + maximum: 599 + detail: + type: string + description: >- + A human-readable explanation specific to this + occurrence of the problem. + instance: + type: string + description: >- + A URI reference that identifies the specific + occurrence of the problem. It may or may not yield further + information if dereferenced. + +# Consumers SHOULD NOT parse the "detail" member for information; +# extensions are more suitable and less error-prone ways to obtain such +# information. +# See: https://datatracker.ietf.org/doc/html/rfc7807#section-3.2 \ No newline at end of file diff --git a/openapi/components/schemas/Schema.yaml b/openapi/components/schemas/Schema.yaml new file mode 100644 index 0000000..308414a --- /dev/null +++ b/openapi/components/schemas/Schema.yaml @@ -0,0 +1,154 @@ +type: object +title: Scalars +properties: + stringProperty: + description: Property name's description (type is string) + type: string + examples: + - example + - sample + readOnlyStringProperty: + description: Notice this only appears in the response. + type: string + readOnly: true + examples: + - example + writeOnlyStringProperty: + description: Notice this only appears in the request. + type: string + writeOnly: true + examples: + - example + minLengthString: + description: Property name's description (type is string) + type: string + minLength: 4 + examples: + - example + maxLengthString: + description: Property name's description (type is string) + type: string + maxLength: 140 + examples: + - example + minAndMaxLengthString: + description: Property name's description (type is string) + type: string + minLength: 4 + maxLength: 140 + examples: + - example + nullableOrStringProperty: + description: Property name's description (type is string or null) + type: + - string + - null + examples: + - example + stringEnumValues: + description: Property name's description (type is string) + type: string + enum: + - sample + - example + - specimen + - case + - instance + - illustration + stringDateTime: + description: Property name's description (type is string, format is date-time) + type: string + format: date-time + stringDate: + description: Property name's description (type is string, format is date-time) + type: string + format: date + stringEmail: + description: Property name's description (type is string, format is email) + type: string + format: email + stringIpAddressV4: + description: Property name's description (type is string, format is ipv4 address) + type: string + format: ipv4 + stringIpAddressV6: + description: Property name's description (type is string, format is ipv6 address) + type: string + format: ipv6 + stringPassword: + description: Property name's description (type is string, format is password) + type: string + format: password + stringHostname: + description: Property name's description (type is string, format is hostname) + type: string + format: hostname + stringUri: + description: Property name's description (type is string, format is uri) + type: string + format: uri + stringUuid: + description: Property name's description (type is string, format is uuid) + type: string + format: uuid + numberProperty: + description: Property name's description (type is number) + type: number + example: 8 + numberFloat: + description: Property name's description (type is number, format is float) + type: number + format: float + numberDouble: + description: Property name's description (type is number, format is double) + type: number + format: double + numberGreaterThanOrEquals: + description: Property name's description (type is number) + type: number + minimum: 5 + numberGreaterThan: + description: Property name's description (type is number) + type: number + exclusiveMinimum: 5 + numberLessThan: + description: Property name's description (type is number) + type: number + exclusiveMaximum: 8 + numberLessThanOrEquals: + description: Property name's description (type is number) + type: number + maximum: 8 + numberRange: + description: Property name's description (type is number) + type: number + minimum: 5 + maximum: 8 + numberRangeExclusiveMaximum: + description: Property name's description (type is number) + type: number + minimum: 5 + exclusiveMaximum: 8 + numberRangeExclusiveMinimumAndMaximum: + description: Property name's description (type is number) + type: number + exclusiveMinimum: 5 + exclusiveMaximum: 8 + numberMultipleOf: + description: Property name's description (type is number) + type: number + multipleOf: 2 + integerType: + description: Property name's description (type is integer) + type: integer + integer32bit: + description: Property name's description (type is integer, format is int32) + type: integer + format: int32 + integer64bit: + description: Property name's description (type is integer, format is int64) + type: integer + format: int64 + booleanProperty: + description: Property name's description (type is boolean) + type: boolean diff --git a/openapi/components/schemas/User.yaml b/openapi/components/schemas/User.yaml new file mode 100644 index 0000000..efdeb3b --- /dev/null +++ b/openapi/components/schemas/User.yaml @@ -0,0 +1,19 @@ +type: object +properties: + username: + description: User supplied username + type: string + minLength: 4 + example: John78 + firstName: + description: User first name + type: string + minLength: 1 + example: John + lastName: + description: User last name + type: string + minLength: 1 + example: Smith + email: + $ref: ./Email.yaml diff --git a/openapi/components/schemas/access/acl-v1.yaml b/openapi/components/schemas/access/acl-v1.yaml new file mode 100644 index 0000000..36a1110 --- /dev/null +++ b/openapi/components/schemas/access/acl-v1.yaml @@ -0,0 +1,11 @@ +type: object +description: list of rights available to the merchant'a admin +properties: + flags: + type: string + description: list of right types available to merchant's admins. Available values are 'none', 'createInvoice', + 'listInvoices', 'findInvoice', 'invoicePayouts', 'listInvoiceHistory', 'createWallet', 'getWallets', + 'getWalletById', 'createAddress', 'getWalletAddresse', 'getWalletAddresses', 'getWalletTransactions', + 'getWalletTransaction', 'spendRequest', 'confirmSpendingFunds', 'createClientWebHook', 'getWebhooks', + 'updateWebhook', 'deleteWebhook', 'createVirtualInvoice', 'updateVirtualInvoice', 'deleteVirtualInvoice', + 'getVirtualInvoice', 'getVirtualInvoices', 'all' \ No newline at end of file diff --git a/openapi/components/schemas/currencies/arrayOfCurrencies.yaml b/openapi/components/schemas/currencies/arrayOfCurrencies.yaml new file mode 100644 index 0000000..6b2a19d --- /dev/null +++ b/openapi/components/schemas/currencies/arrayOfCurrencies.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: './currencySchema.yaml' \ No newline at end of file diff --git a/openapi/components/schemas/currencies/currencyConversionLimits.yaml b/openapi/components/schemas/currencies/currencyConversionLimits.yaml new file mode 100644 index 0000000..044b82a --- /dev/null +++ b/openapi/components/schemas/currencies/currencyConversionLimits.yaml @@ -0,0 +1,10 @@ +type: object +properties: + min: + type: integer + example: 462945000 + description: minimum amount of the source currency that can be converted + max: + type: integer + example: 6939885265000 + description: maximum amount of the source currency that can be converted diff --git a/openapi/components/schemas/currencies/currencyConversions-v1.yaml b/openapi/components/schemas/currencies/currencyConversions-v1.yaml new file mode 100644 index 0000000..c8f0a45 --- /dev/null +++ b/openapi/components/schemas/currencies/currencyConversions-v1.yaml @@ -0,0 +1,12 @@ +type: array +items: + type: object + properties: + from: + description: source currency + type: string + example: '4' + to: + description: destination currency + type: string + example: '6' diff --git a/openapi/components/schemas/currencies/currencyConversions-v2.yaml b/openapi/components/schemas/currencies/currencyConversions-v2.yaml new file mode 100644 index 0000000..7ae3690 --- /dev/null +++ b/openapi/components/schemas/currencies/currencyConversions-v2.yaml @@ -0,0 +1,18 @@ +type: array +items: + type: object + properties: + from: + description: source currency + type: string + example: '4' + fromSymbol: + description: symbol of the source currency + type: string + to: + description: destination currency + type: string + example: '6' + toSymbol: + description: symbol of the destination currency + type: string diff --git a/openapi/components/schemas/currencies/currencySchema.yaml b/openapi/components/schemas/currencies/currencySchema.yaml new file mode 100644 index 0000000..0c4ad3e --- /dev/null +++ b/openapi/components/schemas/currencies/currencySchema.yaml @@ -0,0 +1,48 @@ +type: object +description: currency details +properties: + id: + description: currency Id + type: string + example: '1' + type: + description: currency type, i.e. crypto or fiat + type: string + example: 'crypto' + symbol: + description: currency symbol + type: string + example: 'BTC' + name: + description: currency name + type: string + example: 'Bitcoin' + logo: + $ref: './logo.yaml' + decimalPlaces: + type: integer + description: number of decimal places to display amounts in the currency + example: 0 + rank: + type: integer + example: 0 + description: rank of the currency in the CoinPayments system + status: + type: string + example: active + description: status of the currency in the CoinPayments system + capabilities: + type: string + description: array of strings with currency capabilities, possible values are 'payments', 'singleSigAccounts', 'pooledAccounts', 'utxo' + urls: + $ref: './urls.yaml' + requiredConfirmations: + type: integer + description: number of required confirmations on chain for the transaction to be considered completed + example: 0 + isEnabledForPayment: + type: boolean + description: a flag indicating whether currency has been enabled for making payments + + + diff --git a/openapi/components/schemas/currencies/latest-block-number.yaml b/openapi/components/schemas/currencies/latest-block-number.yaml new file mode 100644 index 0000000..07e3fd7 --- /dev/null +++ b/openapi/components/schemas/currencies/latest-block-number.yaml @@ -0,0 +1,11 @@ +type: object +properties: + currencyId: + description: currency Id + type: string + example: '1' + latestBlockNumber: + description: latest block number + type: integer + example: 773862 + diff --git a/openapi/components/schemas/currencies/logo.yaml b/openapi/components/schemas/currencies/logo.yaml new file mode 100644 index 0000000..a62b0c6 --- /dev/null +++ b/openapi/components/schemas/currencies/logo.yaml @@ -0,0 +1,9 @@ +type: object +description: currency logo / icon +properties: + iamgeUrl: + type: string + description: link to the currency logo image + vectorUrl: + type: string + description: link to the currency logo in vector format diff --git a/openapi/components/schemas/currencies/requiredConfirmations-v1.yaml b/openapi/components/schemas/currencies/requiredConfirmations-v1.yaml new file mode 100644 index 0000000..9714b7e --- /dev/null +++ b/openapi/components/schemas/currencies/requiredConfirmations-v1.yaml @@ -0,0 +1,12 @@ +type: array +items: + type: object + properties: + currencyId: + description: currency Id + type: integer + example: 1 + confirmationsCount: + description: confirmations required + type: integer + example: 0 diff --git a/openapi/components/schemas/currencies/requiredConfirmations-v2.yaml b/openapi/components/schemas/currencies/requiredConfirmations-v2.yaml new file mode 100644 index 0000000..c89b122 --- /dev/null +++ b/openapi/components/schemas/currencies/requiredConfirmations-v2.yaml @@ -0,0 +1,14 @@ +type: array +items: + type: object + properties: + currencyId: + description: currency Id + type: string + currencySymbol: + description: currency symbol + type: string + confirmationsCount: + description: confirmations required + type: integer + example: 0 diff --git a/openapi/components/schemas/currencies/urls.yaml b/openapi/components/schemas/currencies/urls.yaml new file mode 100644 index 0000000..4a5d135 --- /dev/null +++ b/openapi/components/schemas/currencies/urls.yaml @@ -0,0 +1,14 @@ +type: object +properties: + websites: + type: array + description: links to the currency origin sites + items: + type: string + example: ['https://bitcoin.org'] + explorers: + type: array + description: links to the currency explorer sites + items: + type: string + example: ['https://blockchain.info'] diff --git a/openapi/components/schemas/invoices/breakdown.yaml b/openapi/components/schemas/invoices/breakdown.yaml new file mode 100644 index 0000000..0edd05b --- /dev/null +++ b/openapi/components/schemas/invoices/breakdown.yaml @@ -0,0 +1,5 @@ +type: object +properties: + currencyId: + $ref: ../../globalTypes/currencyId.yaml + diff --git a/openapi/components/schemas/invoices/buy-now-button-v1.yaml b/openapi/components/schemas/invoices/buy-now-button-v1.yaml new file mode 100644 index 0000000..e4bd720 --- /dev/null +++ b/openapi/components/schemas/invoices/buy-now-button-v1.yaml @@ -0,0 +1,96 @@ +type: object +description: Request to create a buy-now button, which allows for quick checkout for goods or services with a statement of the + sum due, that are offered by the merchant, and that a buyer intends to purchase +required: + - amount +properties: + successUrl: + type: string + description: the url to redirect to once an invoice is successfully paid + cancelUrl: + type: string + description: the url to redirect to, if payment of an invoice fails (e.g. expired) or is cancelled by the user + ipnUrl: + type: string + description: the url for receiving webhooks on payment + notifications: + type: array + description: comma separated list of strings designating notification types to be sent as webhooks for the payment. + Available values are invoiceCreated, invoicePending, invoicePaid, invoiceCompleted, invoiceCancelled, invoiceTimedOut. + If the list of notification events that merchant wants to receive is not provided, the merchant will receive a + "bad request" error in the response + emailNotifications: + type: boolean + description: flag indicating whether to send an email notification once payment completes successfully + buttonWidth: + type: string + description: width of the created button in pixels + example: '252' + buttonStyle: + type: string + description: style of the button; possible values are "white", "black", "blackblue", "blue", "white_square", "black_square", + "blackblue_square", "blue_square", "white_big", "black_big", "blackblue_big", "blue_big" + invoiceId: + type: string + description: id of the invoice in GUID format. Either id provided by the merchant or, if left 'null' by the merchant, id assigned + to the invoice by CoinPayments + type: + type: string + description: type of the button. Possible values are 'permanent' - button that has no limited lifetime. By clicking on the button + each time a new invoice is generated. 'singleInvoice' - button intended for single payment. The button has a limited + lifetime set up by CoinPayments. By re-clicking the button, original invoice is opened + items: + type: array + description: array of items that a buyer intends to purchase from the merchant + items: + $ref: ./items-v1.yaml + amount: + type: object + required: + - breakdown + - currencyId + - value + description: detailed amount of purchase with the breakdown of all fees + properties: + breakdown: + type: object + required: + - subtotal + properties: + subtotal: + description: sum of purchased items + $ref: ../../globalTypes/globalAmount.yaml + shipping: + description: cost of shipping + $ref: ../../globalTypes/globalAmount.yaml + handling: + description: service cost for processing order + $ref: ../../globalTypes/globalAmount.yaml + taxTotal: + description: tax cost + $ref: ../../globalTypes/globalAmount.yaml + discount: + description: discount amount + $ref: ../../globalTypes/globalAmount.yaml + currencyId: + type: string + description: original currency Id of the item + displayValue: + type: string + description: the value of purchase formatted for display (e.g 0.1234 BTC) + value: + type: string + description: the value of purchase represented as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0 + example: '20000' + valueAsDecimal: + type: number + description: the decimal value represents the monetary value of purchase with decimal precision derived from the value field, + which is the integer representation in the smallest unit of the currency or token + example: 20000 + hideShoppingCart: + type: boolean + description: flag for hiding shopping cart in the checkout window. By default is 'false'. If set to 'true', shopping cart icon + in the checkout window is not displayed \ No newline at end of file diff --git a/openapi/components/schemas/invoices/buy-now-button-v2.yaml b/openapi/components/schemas/invoices/buy-now-button-v2.yaml new file mode 100644 index 0000000..5b82d9a --- /dev/null +++ b/openapi/components/schemas/invoices/buy-now-button-v2.yaml @@ -0,0 +1,83 @@ +type: object +description: Request to create a buy-now button, which allows for quick checkout for goods or services with a statement of the + sum due, that are offered by the merchant, and that a buyer intends to purchase +required: + - amount +properties: + currency: + type: string + description: currency of the items value in the invoice + items: + type: array + description: array of items that a buyer intends to purchase from the merchant + items: + $ref: ./items-v2.yaml + amount: + type: object + required: + - breakdown + - total + description: detailed amount of purchase with the breakdown of all fees in the standard crypto units + properties: + breakdown: + type: object + required: + - subtotal + properties: + subtotal: + description: sum of purchased items + type: string + shipping: + description: cost of shipping + type: string + handling: + description: service cost for processing order + type: string + taxTotal: + description: tax cost + type: string + discount: + description: discount amount + type: string + total: + description: total amount of the invoice + type: string + hideShoppingCart: + type: boolean + description: flag for hiding shopping cart in the checkout window. By default is 'false'. If set to 'true', shopping cart icon + in the checkout window is not displayed + successUrl: + type: string + description: the url to redirect to once an invoice is successfully paid + cancelUrl: + type: string + description: the url to redirect to, if payment of the invoice fails (e.g. expired) or is cancelled by the user + ipnUrl: + type: string + description: the url for receiving webhooks on payment + notifications: + type: array + description: comma separated list of strings designating notification types to be sent as webhooks for the payment. + Available values are 'invoiceCreated', 'invoicePending', 'invoicePaid', 'invoiceCompleted', 'invoiceCancelled', 'invoiceTimedOut'. + If the list of notification events that merchant wants to receive is not provided, the merchant will receive a + "bad request" error in the response + emailNotifications: + type: boolean + description: flag indicating whether to send an email notification once payment completes successfully + buttonWidth: + type: integer + description: width of the created button in pixels + example: '252' + buttonStyle: + type: string + description: style of the button; possible values are "white", "black", "blackblue", "blue", "white_square", "black_square", + "blackblue_square", "blue_square", "white_big", "black_big", "blackblue_big", "blue_big" + invoiceId: + type: string + description: id of the invoice in GUID format. Either id provided by the merchant or, if left 'null' by the merchant, id assigned + to the invoice by CoinPayments + type: + type: string + description: type of the button. Possible values are 'permanent' - button that has no limited lifetime. By clicking on the button + each time a new invoice is generated. 'singleInvoice' - button intended for single payment. The button has a limited + lifetime set up by CoinPayments. By re-clicking the button, original invoice is opened \ No newline at end of file diff --git a/openapi/components/schemas/invoices/buyer.yaml b/openapi/components/schemas/invoices/buyer.yaml new file mode 100644 index 0000000..cd83d0c --- /dev/null +++ b/openapi/components/schemas/invoices/buyer.yaml @@ -0,0 +1,15 @@ +type: object +properties: + companyName: + type: string + description: company name of the buyer + name: + $ref: ../../globalTypes/fullName.yaml + emailAddress: + type: string + description: email address of the buyer + phoneNumber: + type: string + description: phone number of the buyer + address: + $ref: ../../globalTypes/physicalAddress.yaml diff --git a/openapi/components/schemas/invoices/invoice-v1.yaml b/openapi/components/schemas/invoices/invoice-v1.yaml new file mode 100644 index 0000000..40b4bad --- /dev/null +++ b/openapi/components/schemas/invoices/invoice-v1.yaml @@ -0,0 +1,193 @@ +type: object +description: 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 +required: + - items + - amount +properties: + isEmailDelivery: + type: boolean + description: default value to be used for whitelabeling checkout flow. For invoice document delivery indicates if invoice will be email delivered + default: false + emailDelivery: + type: object + description: email addresses to be used for invoice delivery + properties: + to: + type: string + description: to email address. The value can take multiple addresses separated by semicolons + cc: + type: string + description: field to add multiple recipients separated by semicolons + bcc: + type: string + description: bcc field similar to "cc" field except that other recipients won't be able to see that someone else has been sent a copy of the email + dueDate: + type: string + example: '2023-04-26T18:40:41.322Z' + description: date until invoice document is due + invoiceDate: + type: string + example: '2022-11-28T13:59:46+00:00' + description: to be used for invoice doc delivery. Date when invoice is to be mailed out to the user + draft: + type: boolean + description: Default value to be used for whitelabeling checkout flow. Flag indicating whether this is a draft invoice + default: false + clientId: + type: string + description: the id of the client (merchant) creating this invoice + invoiceId: + type: string + description: default value to be used for whitelabeling checkout flow. For invoice document delivery invoice number assigned by the merchant + default: false + buyer: + $ref: ./buyer.yaml + description: + type: string + description: the purchase description, can be provided instead of a list of items + shipping: + description: shipping method info + $ref: ../../globalTypes/shipping.yaml + requireBuyerNameAndEmail: + type: boolean + description: flag indicating whether a buyer name and email are required, they will be requested at checkout if not provider by the caller. + buyerDataCollectionMessage: + type: string + description: the message to display when collecting buyer user data + notes: + type: string + description: notes for the merchant only, these are not visible to the buyers + notesToRecipient: + type: string + description: any additional information to share with the buyer about the transaction + termsAndConditions: + type: string + description: any terms and conditions, e.g. a cancellation policy + merchantOptions: + description: merchant's details to be shown on the invoice + $ref: ./merchantOptions.yaml + customData: + type: object + description: any custom data merchant wishes to attach to the invoice that may be further used for custom merchant's purposes. Not visible on UI for buyers + metadata: + type: object + properties: + integration: + type: string + description: integration name + format: InvoiceBuilder + hostname: + type: string + description: server name of the integration API + poNumber: + type: string + description: optional Purchase order number on the integration API. + format: InvoiceBuilder + webhooks: + description: data on webhooks sent for the invoice + type: array + items: + type: object + properties: + notificationsUrl: + $ref: ../../globalTypes/notificationUrl.yaml + notifications: + $ref: ../../globalTypes/notifications.yaml + payoutOverrides: + type: array + description: optional config to specify payout mode for currencies for this particular invoice. Overrides account payout configs for currencies + items: + type: object + properties: + fromCurrency: + type: string + description: the currency Id of the wallet or address in which payment is made + toCurrency: + type: string + description: the currency Id of the wallet or address in which payout is made. In case is different from `fromCurrency`, payout is made with conversion + address: + type: string + description: the external address into which to pay out to + frequency: + type: array + description: frequency of payout execution. Possible values of the array - 'normal', 'asSoonAsPossible', 'hourly', 'nightly', 'weekly' + example: ['normal', + 'asSoonAsPossible', + 'hourly', + 'nightly', + 'weekly' + ] + payment: + type: object + required: + - refundEmail + description: the field contains additional data specific for whitelabeled payments, e.g. buyer's email that is used + for possible refunds + properties: + paymentCurrency: + type: string + description: id of the currency to conduct payment of the invoice. By providing this value in the 'createInvoice' + request, merchant automatically generates payment address for the identified currency. The response in this + case will contain payment address (HotWallet) information for buyer to make a payment. In case 'paymentCurrency' + is not specified in the 'createInvoice' request, the response will contain the list of all available currencies + for payment. Selecting the address for payment should be triggered as a separate action by using + 'getPaymentAddressByCurrency' endpoint + refundEmail: + type: string + description: Provide the buyer’s email address to create a white-labeling payment flow. **Note**, the email is + only used for transaction status updates and refunds; never for marketing purposes + items: + type: array + description: array of items that a buyer intends to purchase from the merchant + items: + $ref: ./items-v1.yaml + amount: + type: object + required: + - breakdown + - currencyId + - value + description: detailed amount of purchase with the breakdown of all fees + properties: + breakdown: + description: breakdown of invoice costs + type: object + required: + - subtotal + properties: + subtotal: + description: sum of purchased items + $ref: ../../globalTypes/globalAmount.yaml + shipping: + description: cost of shipping + $ref: ../../globalTypes/globalAmount.yaml + taxTotal: + description: tax cost + $ref: ../../globalTypes/globalAmount.yaml + discount: + description: discount amount for the whole purchase + $ref: ../../globalTypes/globalAmount.yaml + currencyId: + type: string + description: original currency Id of the item + contractAddress: + type: string + description: the address of the contract if this money object represents an ERC20 or similar token value + displayValue: + type: string + description: purchase value formatted for display (e.g 0.1234 BTC) + value: + type: string + description: this parameter represents the monetary value of purchase as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0 + valueAsDecimal: + type: string + description: the decimal value of purchase represents the monetary value with decimal precision derived from the value field, + which is the integer representation in the smallest unit of the currency or token. + hideShoppingCart: + type: boolean + description: flag for hiding shopping cart in the checkout window. By default is 'false'. If set to 'true', shopping cart icon + in the checkout window is not displayed \ No newline at end of file diff --git a/openapi/components/schemas/invoices/invoice-v2.yaml b/openapi/components/schemas/invoices/invoice-v2.yaml new file mode 100644 index 0000000..2958d63 --- /dev/null +++ b/openapi/components/schemas/invoices/invoice-v2.yaml @@ -0,0 +1,169 @@ +type: object +description: 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 +required: + - currency + - items + - amount +properties: + currency: + type: string + description: currency in which invoice has been issued + items: + type: array + description: array of items that a buyer intends to purchase from the merchant + items: + $ref: ./items-v2.yaml + amount: + type: object + required: + - breakdown + - total + description: detailed amount of purchase with the breakdown of all fees in the simple crypto units + properties: + breakdown: + type: object + required: + - subtotal + properties: + subtotal: + description: sum of purchased items + type: string + shipping: + description: cost of shipping + type: string + handling: + description: service cost for processing order + type: string + taxTotal: + description: tax cost + type: string + discount: + description: discount amount + type: string + total: + description: total amount of the invoice + type: string + isEmailDelivery: + type: boolean + description: default value to be used for whitelabeling checkout flow. For invoice document delivery indicates if invoice will be email delivered + default: false + emailDelivery: + type: object + description: email addresses to be used for invoice delivery + properties: + to: + type: string + description: to email address. The value can take multiple addresses separated by semicolons + cc: + type: string + description: field to add multiple recipients separated by semicolons + bcc: + type: string + description: bcc field similar to "cc" field except that other recipients won't be able to see that someone else has been sent a copy of the email + dueDate: + type: string + example: '2023-04-26T18:40:41.322Z' + description: date until invoice document is due + invoiceDate: + type: string + example: '2022-11-28T13:59:46+00:00' + description: to be used for invoice doc delivery. Date when invoice is to be mailed out to the user or activated for payment + draft: + type: boolean + description: Default value to be used for whitelabeling checkout flow. Flag indicating whether this is a draft invoice + default: false + clientId: + type: string + description: the id of the client (merchant) creating this invoice + invoiceId: + type: string + description: default value to be used for whitelabeling checkout flow. For invoice document delivery invoice number assigned by the merchant + default: false + buyer: + $ref: ./buyer.yaml + description: + type: string + description: the purchase description, can be provided instead of a list of items + shipping: + description: shipping method info + $ref: ../../globalTypes/shipping.yaml + requireBuyerNameAndEmail: + type: boolean + description: flag indicating whether a buyer name and email are required, they will be requested at checkout if not provider by the caller. + buyerDataCollectionMessage: + type: string + description: the message to display when collecting buyer user data + notes: + type: string + description: notes for the merchant only, these are not visible to the buyers + notesToRecipient: + type: string + description: any additional information to share with the buyer about the transaction + termsAndConditions: + type: string + description: any terms and conditions, e.g. a cancellation policy + merchantOptions: + description: merchant's details to be shown on the invoice + $ref: ./merchantOptions.yaml + customData: + type: object + description: any custom data merchant wishes to attach to the invoice that may be further used for custom merchant's purposes. Not visible on UI for buyers + poNumber: + type: string + description: optional Purchase order number on the integration API + webhooks: + description: data on webhooks sent for the invoice + type: array + items: + type: object + properties: + notificationsUrl: + $ref: ../../globalTypes/notificationUrl.yaml + notifications: + $ref: ../../globalTypes/notifications.yaml + payoutOverrides: + type: array + description: optional config to specify payout mode for currencies for this particular invoice. Overrides account payout configs for currencies + items: + type: object + properties: + fromCurrency: + type: string + description: the currency Id of the wallet or address in which payment is made + toCurrency: + type: string + description: the currency Id of the wallet or address in which payout is made. In case is different from `fromCurrency`, payout is made with conversion + address: + type: string + description: the external address into which to pay out to + frequency: + type: array + description: frequency of payout execution. Possible values of the array - 'normal', 'asSoonAsPossible', 'hourly', 'nightly', 'weekly' + example: [ 'normal', + 'asSoonAsPossible', + 'hourly', + 'nightly', + 'weekly' + ] + payment: + type: object + description: the field contains additional data specific for whitelabeled payments, e.g. buyer's email that is used + for possible refunds + properties: + paymentCurrency: + type: string + description: id of the currency to conduct payment of the invoice. By providing this value in the 'createInvoice' + request, merchant automatically generates payment address for the identified currency. The response in this + case will contain payment address (HotWallet) information for buyer to make a payment. In case 'paymentCurrency' + is not specified in the 'createInvoice' request, the response will contain the list of all available currencies + for payment. Selecting the address for payment should be triggered as a separate action by using + 'getPaymentAddressByCurrency' endpoint + refundEmail: + type: string + description: Provide the buyer’s email address to create a white-labeling payment flow. **Note**, the email is + only used for transaction status updates and refunds; never for marketing purposes + hideShoppingCart: + type: boolean + description: flag for hiding shopping cart in the checkout window. By default is 'false'. If set to 'true', shopping cart icon + in the checkout window is not displayed \ No newline at end of file diff --git a/openapi/components/schemas/invoices/invoiceHistory.yaml b/openapi/components/schemas/invoices/invoiceHistory.yaml new file mode 100644 index 0000000..2484c1d --- /dev/null +++ b/openapi/components/schemas/invoices/invoiceHistory.yaml @@ -0,0 +1,8 @@ +type: object +properties: + items: + type: array + items: + $ref: ./invoiceHistoryItems.yaml + paging: + $ref: ../../globalTypes/paging.yaml \ No newline at end of file diff --git a/openapi/components/schemas/invoices/invoiceHistoryItems.yaml b/openapi/components/schemas/invoices/invoiceHistoryItems.yaml new file mode 100644 index 0000000..630f500 --- /dev/null +++ b/openapi/components/schemas/invoices/invoiceHistoryItems.yaml @@ -0,0 +1,35 @@ +type: object +properties: + timestamp: + type: string + description: the timestamp of when the this event was observed + example: '2023-05-29T19:58:50.043Z' + eventType: + type: string + description: the type of event that was observed. Possible values are + - *created* – invoice has been created. Invoice stays in the “Created” status until payment is detected and invoice + moves to “Pending”, or it is expired and moves to “TimedOut”, or it is cancelled by merchant and moves to + “Cancelled”, or it is "Deleted" by merchant. + - *updated* – invoice has been updated. Update can take place after invoice is created but before any payment on the + invoice is detected. + - *draft* – invoice is saved as draft. This is an invoice that has not been fully created and shared with buyer. No + payment can be created for the invoice. + - *scheduled* – invoice is created and saved for being activated (sent to buyer) for a future date. + - *unpaid* – A buyer has initiated payment (checkout flow) but the payment has not been detected in the blockchain mempool yet. + Invoice remains in the “Unpaid” status until buyer completes checkout and funds are detected in the blockchain mempool. + In case buyer has completed payment checkout flow, invoice moves to the “Pending” status. If payment, nevertheless, + fails, invoice moves back to “Unpaid”. + - *pending* – funds for the invoice have been detected in the blockchain mempool or on chain. It can be either full + payment or under-/overpayment. + - *paid* – full payment for the invoice gets enough confirmations on chain. + - *scheduledForPayout* – received funds are scheduled for payout according to the merchant settings, but payout has not + been completed yet. + - *completed* – payout is completed, funds have reached merchant’s destination address. + - *cancelled* – merchant manually cancels invoice before buyer initiates first payment for the invoice. Also, if the + initiated payment has expired and there are no funds detected on chain for the invoice, merchant still can cancel the invoice. + - *cancelling* – the process of the invoice cancellation has been initiated. Since cancellation may take several seconds, + it might result in an additional status of “Cancelling” and then invoice is set to the “Cancelled” status. + - *timedOut* – invoice lifetime has timed out and no funds have been received on it so far, no pending payment has been + detected, no checkout flow initiated at the moment of expiration. + - *deleted* – merchant created invoice but then deletes it purposefully. At the moment of deletion no funds have been + received on the invoice, no pending payment has been detected, no checkout flow initiated. \ No newline at end of file diff --git a/openapi/components/schemas/invoices/items-v1.yaml b/openapi/components/schemas/invoices/items-v1.yaml new file mode 100644 index 0000000..2d6feb0 --- /dev/null +++ b/openapi/components/schemas/invoices/items-v1.yaml @@ -0,0 +1,43 @@ +type: object +description: array of items that a buyer intends to purchase from the merchant +required: + - name + - quantity + - amount +properties: + customId: + type: string + description: item Id in the merchant's system + sku: + type: string + description: item SKU number + name: + type: string + description: name or title of the item + example: 'Iphone 22' + description: + type: string + description: description of the item + quantity: + type: object + properties: + value: + type: integer + description: the quantity of the item. Must be greater than 0 and less than 999,999,999. Defaults to 1 if not provided + type: + type: string + description: type of the sold product, can be "1" = "hours" or "2" = "units" + example: '1' + originalAmount: + description: represents the value of one item in the original currency, typically fiat currency such as USD or EUR. + The value is indicated without any discount amount applied on it + $ref: ../../globalTypes/globalAmount.yaml + amount: + description: represents the total value of all units of the item bought with the discount applied on top of it. The value is in the original + currency, typically fiat currency such as USD or EUR. Values will be used to calculate the amount the buyer should + pay in their selected currency of payment + $ref: ../../globalTypes/globalAmount.yaml + tax: + description: Amount of tax to be added to the amount of the purchase. Values will be used to calculate the amount + the buyer should pay in their selected currency of payment + $ref: ../../globalTypes/globalAmount.yaml diff --git a/openapi/components/schemas/invoices/items-v2.yaml b/openapi/components/schemas/invoices/items-v2.yaml new file mode 100644 index 0000000..2b27a0c --- /dev/null +++ b/openapi/components/schemas/invoices/items-v2.yaml @@ -0,0 +1,43 @@ +type: object +description: array of items that a buyer intends to purchase from the merchant +required: + - name + - quantity + - amount +properties: + customId: + type: string + description: item Id in the merchant's system + sku: + type: string + description: item SKU number + name: + type: string + description: name or title of the item + example: 'Iphone 22' + description: + type: string + description: description of the item + quantity: + type: object + properties: + value: + type: integer + description: the quantity of the item. Must be greater than 0 and less than 999,999,999. Defaults to 1 if not provided + type: + type: string + description: type of the sold product, can be "1" = "hours" or "2" = "units" + example: 1 + originalAmount: + description: represents the value of one item in the original currency, typically fiat currency such as USD or EUR. + The value is indicated without any discount amount applied on it + type: string + amount: + description: represents the total value of all units of the item bought with the discount applied on top of it. The value is in the original + currency, typically fiat currency such as USD or EUR. Values will be used to calculate the amount the buyer should + pay in their selected currency of payment + type: string + tax: + description: Amount of tax to be added to the amount of the purchase. Values will be used to calculate the amount + the buyer should pay in their selected currency of payment + type: string diff --git a/openapi/components/schemas/invoices/merchantOptions.yaml b/openapi/components/schemas/invoices/merchantOptions.yaml new file mode 100644 index 0000000..5ee65f7 --- /dev/null +++ b/openapi/components/schemas/invoices/merchantOptions.yaml @@ -0,0 +1,21 @@ +type: object +properties: + showAddress: + type: boolean + description: indicates whether to show merchant’s address on the invoice + default: false + showPhone: + type: boolean + description: indicates whether to show merchant’s phone number on the invoice + default: false + showRegistrationNumber: + type: boolean + description: indicates whether to show merchant’s registration number on the invoice + default: false + showEmail: + type: boolean + description: indicates whether to show merchant’s email address on the invoice + default: false + additionalInfo: + type: string + description: indicates whether to show any other merchant’s additional info on the invoice diff --git a/openapi/components/schemas/invoices/payment-status.yaml b/openapi/components/schemas/invoices/payment-status.yaml new file mode 100644 index 0000000..e82fbff --- /dev/null +++ b/openapi/components/schemas/invoices/payment-status.yaml @@ -0,0 +1,54 @@ +type: object +description: Status of invoice +properties: + created: + type: string + description: timestamp when invoice was created + expires: + type: string + description: timestamp when invoice expires + status: + type: string + description: current status of the invoice. Possible values - 'draft', 'scheduled', 'unpaid', 'pending', 'paid', + 'completed', 'cancelled', 'timedOut', 'deleted' + example: ["draft", + "scheduled", + "unpaid", + "pending", + "paid", + "completed", + "cancelled", + "timedOut", + "deleted" + ] + payment: + type: object + description: details of payment of the invoice + properties: + currencyId: + type: integer + description: id of the currency of payment of the invoice + confirmations: + type: integer + description: number of confirmations on the blockchain received by payment of the invoice + requiredConfirmations: + type: integer + description: number of confirmations on the blockchain required by payment of the invoice to be considered completed + confirmedAmount: + type: object + description: Amount of payment on chain that received required amount of confirmations + $ref: ../../globalTypes/fees.yaml + unconfirmedAmount: + type: object + description: Amount of payment on chain that has not received required amount of confirmations yet + $ref: ../../globalTypes/fees.yaml + expectedAmount: + type: object + description: Amount of payment expected to be received as a result of payment of the invoice + $ref: ../../globalTypes/fees.yaml + partialAcceptAvailable: + type: boolean + description: Flag that indicates if acceptance of partial payment is possible + + + diff --git a/openapi/components/schemas/invoices/payouts/PayoutConfig.yaml b/openapi/components/schemas/invoices/payouts/PayoutConfig.yaml new file mode 100644 index 0000000..cb59424 --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/PayoutConfig.yaml @@ -0,0 +1,29 @@ +type: object +properties: + currencyId: + type: object + description: the currency id of the wallet or address into which to payout to + format: int32 + properties: + id: + type: integer + description: currency Id in CoinPayments + smart_contract: + type: string + description: Optional address of the smart contract if the currency supports it + address: + type: string + description: the external address into which to pay out + wallet_id: + type: string + description: id of the wallet into which to payout to. Used if no address is available for the merchant + frequency: + type: string + description: the frequency of payout of the funds to merchant's wallet or address in the currency of payment. + Possible values of the array - 'normal', 'asSoonAsPossible', 'hourly', 'nightly', 'weekly' + example: ['normal', + 'asSoonAsPossible', + 'hourly', + 'nightly', + 'weekly' + ] diff --git a/openapi/components/schemas/invoices/payouts/currency.yaml b/openapi/components/schemas/invoices/payouts/currency.yaml new file mode 100644 index 0000000..1f61f09 --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/currency.yaml @@ -0,0 +1,62 @@ +type: object +properties: + id: + description: the unique id of the currency on the CoinPayments platform + $ref: ../../../globalTypes/id.yaml + type: + type: string + description: the type of the currency (e.g crypto, token or fiat ) + symbol: + type: string + description: | + ticker symbol for the currency. For fiat currencies this is the three character (ISO-4217) currency code, + and for crypto currencies their multi-character symbol. + example: 'BTC' + name: + type: string + description: the name of the currency, e.g. 'United States Dollar' or 'Bitcoin' + logo: + type: object + description: the logo urls for the currency + properties: + imageUrl: + type: string + description: | + 'Link to a CoinPayments hosted image for a currency, 64x64 is the default size returned.' + Replace "64x64" in the image url with these alternative sizes: 32, 64, 128, 200. + vectorUrl: + type: string + description: If available then the link to a CoinPayments hosted vector image (SVG) for the currency. + decimalPlaces: + type: number + description: the number of digits after the decimal separator, e.g. 2 for USD, 8 for BTC, 0 for JPY + example: 0 + rank: + type: number + description: the relative ordering/ranking of this currency to the other supported currencies on the CoinPayments platform + example: 0 + capabilities: + type: array + description: | + the capabilities of the currency on the CoinPayments platform: + - multiSigAccounts: Multi signature 2-of-3 wallets where the user holds the private key + - sharedAccounts: Shared accounts where the keys are held on the server only + - payments: Can be accepted as payments + - singleSigAccounts: Single signature account for personal use. + items: + type: string + example: 'multiSigAccounts' + urls: + type: object + description: Contains various URLs for a currency + properties: + websites: + type: array + description: the official websites for the currency + items: + type: string + explorers: + type: array + description: the explorers for the currency (if crypto or a token) + items: + type: string diff --git a/openapi/components/schemas/invoices/payouts/destinationAmount.yaml b/openapi/components/schemas/invoices/payouts/destinationAmount.yaml new file mode 100644 index 0000000..937ebce --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/destinationAmount.yaml @@ -0,0 +1,6 @@ +type: object +properties: + amount: + $ref: ../../../globalTypes/amount.yaml + nativeAmount: + $ref: ../../../globalTypes/amount.yaml diff --git a/openapi/components/schemas/invoices/payouts/fees.yaml b/openapi/components/schemas/invoices/payouts/fees.yaml new file mode 100644 index 0000000..d8ab554 --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/fees.yaml @@ -0,0 +1,17 @@ +type: object +properties: + displayValue: + type: string + description: 'The value formatted for display (e.g 0.1234 BTC)' + contractAddress: + description: 'the address of the contract if this money object represents an ERC20 or similar token value' + $ref: ../../../globalTypes/address.yaml + value: + type: string + description: | + This parameter represents the monetary value as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0. + currencyId: + $ref: ../../../globalTypes/currencyId.yaml diff --git a/openapi/components/schemas/invoices/payouts/item.yaml b/openapi/components/schemas/invoices/payouts/item.yaml new file mode 100644 index 0000000..148ed94 --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/item.yaml @@ -0,0 +1,41 @@ +type: object +properties: + currency: + description: the currency (merchant's accepted currency) that will be received + $ref: ./currency.yaml + merchantFees: + description: The amount for service fees in the merchant's accepted currency + $ref: ./merchantFees.yaml + payoutAmount: + description: | + This is the amount to be finally paid out to the merchant in the merchant's accepted currency. + An object with the same fields and desription as the fees object in the "transactionFee" under merchantFees. + $ref: ./simulateFees.yaml + payoutAmountInInvoiceCurrency: + description: | + The Pay out amount in the invoice currency. + An object with the same fields and desription as the fees object in the "transactionFee" under merchantFees. + $ref: ./simulateFees.yaml + merchantFeesInInvoiceCurrency: + description: | + The merchant fees in the invoice currency. + An object with the same fields as the fees object in the "transactionFee" under merchantFees. + $ref: ./simulateFees.yaml + merchantPayoutAddress: + type: string + description: the merchant's payment output address at the time the hot wallet was created + sent: + description: the timestamp of when this payout was sent (e.g. broadcast on the blockchain) + $ref: ../../../globalTypes/datetime.yaml + created: + $ref: ../../../globalTypes/datetime.yaml + expected: + description: the approximate timestamp of when this payout is expected to be sent (e.g. broadcast on the blockchain) + $ref: ../../../globalTypes/datetime.yaml + confirmed: + description: the timestamp of when this payout was confirmed (e.g. on the blockchain) + $ref: ../../../globalTypes/datetime.yaml + state: + type: string + description: the current state of the payout + diff --git a/openapi/components/schemas/invoices/payouts/merchantFees.yaml b/openapi/components/schemas/invoices/payouts/merchantFees.yaml new file mode 100644 index 0000000..b47da9a --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/merchantFees.yaml @@ -0,0 +1,10 @@ +type: object +properties: + transactionFees: + $ref: ./fees.yaml + networkFee: + description: An object with the same fields as the fees object in the "transactionFee" + $ref: ./simulateFees.yaml + conversionFee: + description: An object with the same fields as the fees object in the "transactionFee" + $ref: ./simulateFees.yaml diff --git a/openapi/components/schemas/invoices/payouts/paidTransaction.yaml b/openapi/components/schemas/invoices/payouts/paidTransaction.yaml new file mode 100644 index 0000000..934d991 --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/paidTransaction.yaml @@ -0,0 +1,22 @@ +type: object +properties: + hash: + $ref: ../../../globalTypes/txId-or-hash.yaml + amount: + type: object + properties: + displayValue: + type: string + description: 'The value formatted for display (e.g 0.1234 BTC)' + value: + type: string + description: | + This parameter represents the monetary value as an integer in the base (smallest) unit of the currency. For instance, Bitcoin can be divided into 8 decimal places, + with each division known as a Satoshi. Therefore, 1 BTC would have a value of 100,000,000 Satoshis, and 0.00031 BTC would have a value of 31,000 Satoshis. Similarly, + an amount of $9.99 USD would be represented as 999 cents. In the case of zero-decimal currencies like the Yen, a value of ¥500 would be represented as 500. + If no value is provided, the default is 0. + currencyId: + $ref: ../../../globalTypes/currencyId.yaml + conversionId: + type: number + example: 0 diff --git a/openapi/components/schemas/invoices/payouts/payouts-v1.yaml b/openapi/components/schemas/invoices/payouts/payouts-v1.yaml new file mode 100644 index 0000000..11e0ac2 --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/payouts-v1.yaml @@ -0,0 +1,54 @@ +type: object +properties: + paidTransactions: + type: array + description: An array of paid transaction details, including transaction hash, amount, and conversion Id. + items: + $ref: ./paidTransaction.yaml + paidDate: + type: string + description: The date and time when the payment was made. + format: '2022-11-29T12:42:44.513Z' + completedTxId: + type: string + description: The ID of the completed transaction. + format: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + externalAddress: + type: string + description: The external address where the payout is deposited + format: '378a37b57b6b4a4a93fd352b06ce1829' + destinationCurrencyId: + type: string + description: The currency ID of the destination address for the payout + format: '1' + expectedDisplayValue: + type: string + description: The expected amount of the payout. + format: '0.01' + sourceCurrencyId: + type: string + description: The ID of the source currency for the payout + format: '101' + destinationAccountId: + type: string + description: The ID of the destination account for the payout + format: '378a37b57b6b4a4a93fd352b06ce1829' + isConversion: + type: boolean + description: Indicates whether a currency conversion is involved in the payout + example: false + conversionProgress: + type: string + description: The progress status of the currency conversion + example: 0 + settlementModeErrorCode: + type: number + example: 0 + destinationAmount: + description: The destination amount of the payout, including the ammount in the buyer's currency (amount) and the amount in the seller's currency (nativeAmount) + $ref: ./destinationAmount.yaml + items: + type: array + items: + $ref: ./item.yaml + diff --git a/openapi/components/schemas/invoices/payouts/simulateFees.yaml b/openapi/components/schemas/invoices/payouts/simulateFees.yaml new file mode 100644 index 0000000..0479aac --- /dev/null +++ b/openapi/components/schemas/invoices/payouts/simulateFees.yaml @@ -0,0 +1,10 @@ +type: object +properties: + displayValue: + type: string + contractAddress: + $ref: ../../../globalTypes/address.yaml + value: + type: string + currencyId: + $ref: ../../../globalTypes/currencyId.yaml diff --git a/openapi/components/schemas/wallets/MerchantWallet-v1.yaml b/openapi/components/schemas/wallets/MerchantWallet-v1.yaml new file mode 100644 index 0000000..5e5040c --- /dev/null +++ b/openapi/components/schemas/wallets/MerchantWallet-v1.yaml @@ -0,0 +1,26 @@ +type: object +required: + - currencyId + - label +properties: + currencyId: + description: Id of the currency for which wallet is created + type: string + example: 4:0x152649ea73beab28c5b49b26eb48f7ead6d4c898 + label: + description: Label denoting the wallet + type: string + example: John's wallet + webhookUrl: + description: + when provided, CoinPayments API will be sending webhook notifications to this URL + type: string + example: 'https://myapi.com' + contractAddress: + type: string + description: an optional address of the smart contract representing a token + usePermanentAddresses: + type: boolean + description: flag that indicates whether the wallet is to use permanent addresses or temporary ones. The wallet will + support addresses of one type only + diff --git a/openapi/components/schemas/wallets/MerchantWallet-v2.yaml b/openapi/components/schemas/wallets/MerchantWallet-v2.yaml new file mode 100644 index 0000000..d9e0019 --- /dev/null +++ b/openapi/components/schemas/wallets/MerchantWallet-v2.yaml @@ -0,0 +1,22 @@ +type: object +required: + - currency +properties: + currency: + description: Id of the currency for which wallet is created + type: string + example: 4:0x152649ea73beab28c5b49b26eb48f7ead6d4c898 + label: + description: Label denoting the wallet + type: string + example: John's wallet + webhookUrl: + description: + when provided, CoinPayments API will be sending webhook notifications to this URL + type: string + example: 'https://myapi.com' + usePermanentAddresses: + type: boolean + description: flag that indicates whether the wallet is to use permanent addresses or temporary ones. The wallet will + support addresses of one type only + diff --git a/openapi/components/schemas/wallets/MerchantWalletObj-v1.yaml b/openapi/components/schemas/wallets/MerchantWalletObj-v1.yaml new file mode 100644 index 0000000..4d8843c --- /dev/null +++ b/openapi/components/schemas/wallets/MerchantWalletObj-v1.yaml @@ -0,0 +1,76 @@ +type: object +properties: + walletId: + description: Id of the wallet + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + walletType: + type: string + description: type of the wallet + example: [ "singleSigCryptoWallet" + ] + currencyId: + description: Id of the currency which this wallet was created for + type: number + example: 1 + isActive: + type: boolean + description: status of the wallet, i.e. whether it is active and not deactivated or deleted + isLocked: + type: boolean + description: Indicates whether this wallet is locked due to legal reasons + label: + description: label of the wallet + type: string + example: John's wallet + depositAddress: + description: blockchain address of this wallet allowing it to receive funds + type: string + example: '0x9939b7b208012cd0395d1411272be6e34c04af7b' + confirmedBalance: + description: balance of the wallet including only confirmed deposits and withdrawals + $ref: ../../globalTypes/amount.yaml + unconfirmedBalance: + description: balance of the wallet including all unconfirmed deposits and withdrawals + $ref: ../../globalTypes/amount.yaml + unconfirmedNativeBalance: + description: balance of the wallet including all unconfirmed deposits and withdrawals in its native currency + $ref: ../../globalTypes/amount.yaml + confirmedNativeBalance: + description: balance of the wallet including only confirmed deposits and withdrawals in its native currency + $ref: ../../globalTypes/amount.yaml + confirmedTokens: + description: token (e.g. ERC20) balances for this wallet if available in smallest units (e.g. Weis for Ethereum) + type: array + items: + $ref: ../../globalTypes/token.yaml + unconfirmedTokens: + description: the amount of tokens (like ERC20) pending for this wallet + type: array + items: + $ref: ../../globalTypes/token.yaml + canCreateAddress: + description: specifies whether this wallet is allowed to create additional deposit addresses + type: boolean + example: true + isVaultLocked: + description: flag that determines if the wallet vault is locked or not + type: boolean + example: true + vaultLockoutEndDateTime: + description: when used, the vault will start the countdown to unlock when when the specified date and time is reached + type: string + example: '2023-07-04T22:21:41.535Z' + contractAddress: + type: string + description: An optional address of the smart contract representing a token + hasPermanentAddresses: + type: boolean + description: a flag indicating whether the wallet contains permanent addresses. Is used for account-based wallets + hasActiveAddress: + type: boolean + description: indicates whether the wallet has at least one active address + clientId: + type: string + description: list of wallets pertaining to a certain client id + diff --git a/openapi/components/schemas/wallets/MerchantWalletObj-v2.yaml b/openapi/components/schemas/wallets/MerchantWalletObj-v2.yaml new file mode 100644 index 0000000..6ecf988 --- /dev/null +++ b/openapi/components/schemas/wallets/MerchantWalletObj-v2.yaml @@ -0,0 +1,64 @@ +type: object +properties: + walletId: + description: Id of the wallet + type: string + example: 0a54b29f-51cb-44a8-9bed-111c5cb1b335 + walletType: + type: string + description: type of the wallet + example: [ "singleSigCryptoWallet" + ] + currencyId: + description: Id of the currency which this wallet was created for + type: number + example: 1 + isActive: + type: boolean + description: status of the wallet, i.e. whether it is active and not deactivated or deleted + isLocked: + type: boolean + description: Indicates whether this wallet is locked due to legal reasons + label: + description: label of the wallet + type: string + example: John's wallet + depositAddress: + description: blockchain address of this wallet allowing it to receive funds + type: string + example: '0x9939b7b208012cd0395d1411272be6e34c04af7b' + confirmedBalance: + description: balance of the wallet including only confirmed deposits and withdrawals + $ref: ../../globalTypes/amount-v2.yaml + unconfirmedBalance: + description: balance of the wallet including all unconfirmed deposits and withdrawals + $ref: ../../globalTypes/amount-v2.yaml + confirmedNativeBalance: + description: balance of the wallet including only confirmed deposits and withdrawals in its native currency + $ref: ../../globalTypes/amount-v2.yaml + unconfirmedNativeBalance: + description: balance of the wallet including all unconfirmed deposits and withdrawals in its native currency + $ref: ../../globalTypes/amount-v2.yaml + canCreateAddress: + description: specifies whether this wallet is allowed to create additional deposit addresses + type: boolean + example: true + isVaultLocked: + description: flag that determines if the wallet vault is locked or not + type: boolean + example: true + vaultLockoutEndDateTime: + description: when used, the vault will start the countdown to unlock when when the specified date and time is reached + type: string + example: '2023-07-04T22:21:41.535Z' + hasPermanentAddresses: + type: boolean + description: a flag indicating whether the wallet contains permanent addresses. Is used for account-based wallets + hasActiveAddress: + type: boolean + description: indicates whether the wallet has at least one active address + clientId: + type: string + description: list of wallets pertaining to a certain client id + + diff --git a/openapi/components/schemas/wallets/MerchantWalletsConsolidation.yaml b/openapi/components/schemas/wallets/MerchantWalletsConsolidation.yaml new file mode 100644 index 0000000..20ee14e --- /dev/null +++ b/openapi/components/schemas/wallets/MerchantWalletsConsolidation.yaml @@ -0,0 +1,20 @@ +type: object +properties: + wallets: + description: list of wallets with their addresses for which consolidation is executed + type: array + items: + type: object + properties: + walletId: + type: string + description: id of the wallet participating in consolidation + addresses: + type: array + description: list of wallet addresses participating in consolidation + example: [ + "3fa85f64-5717-4562-b3fc-2c963f66afa6" + ] + + + diff --git a/openapi/components/schemas/wallets/NewWallet.yaml b/openapi/components/schemas/wallets/NewWallet.yaml new file mode 100644 index 0000000..6eaa095 --- /dev/null +++ b/openapi/components/schemas/wallets/NewWallet.yaml @@ -0,0 +1,10 @@ +type: object +properties: + walletId: + description: Id of newly created wallet + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + address: + description: deposit address. Can be null for some currencies, then address should be added to the wallet manually + type: string + example: LaN1Vy2FugxWiAyMc8ipKe6Hcnh3mcKuym diff --git a/openapi/components/schemas/wallets/SendConvertRequest.yaml b/openapi/components/schemas/wallets/SendConvertRequest.yaml new file mode 100644 index 0000000..e69de29 diff --git a/openapi/components/schemas/wallets/SpendRequestPayload-v1.yaml b/openapi/components/schemas/wallets/SpendRequestPayload-v1.yaml new file mode 100644 index 0000000..250dc5c --- /dev/null +++ b/openapi/components/schemas/wallets/SpendRequestPayload-v1.yaml @@ -0,0 +1,51 @@ +type: object +required: + - toCurrencyId + - toAddress + - amountInSmallestUnits +properties: + toAddress: + description: Address where client wants to send funds to + type: string + example: 'mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9' + toCurrencyId: + description: currency Id of the beneficiary wallet + type: number + example: 6 + fromContractAddress: + description: Address of the contract of the "fromCurrency" e.g. "0xdac17f958d2ee523a2206206994597c13d831ec7" for ERC20 TetherUSD. + The field is optional for simple withdrawals. The field is required for conversions when the source currency and the destination + currencies of the spend request are different + type: string + example: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' + toContractAddress: + description: Address of the contract of the "toCurrency" e.g. "0xdac17f958d2ee523a2206206994597c13d831ec7" for ERC20 TetherUSD + type: string + example: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' + amountInSmallestUnits: + description: | + refers to the amount of a specific cryptocurrency, such as Bitcoin, measured in its smallest divisible unit, AKA atomic units + (e.g., Satoshis for Bitcoin). + It allows for precise and detailed transactions by specifying the amount in the smallest possible denomination. + This approach enables you to send fractional amounts of the currency accurately. + type: string + example: '9900000' + blockchainFeeOverrideInSmallestUnits: + description: Used for overriding the system suggested blockchain fee (within 10% range) to manage the transaction processing speed + type: number + example: '0.0003234' + memo: + description: user-defined note for the funds withdrawal + type: string + receiverPaysFee: + description: | + When set to true, the receiver of the transaction will pay the fees. In this case, + the AmountInSmallestUnits will be deducted from the source balance, and the receiver will receive the remaining amount after deducting the fees. + When set to false (or not provided), the fees will be added to the AmountInSmallestUnits, + and the total sum (including fees) will be deducted from the source balance. + The receiver will receive the AmountInSmallestUnits exactly as specified. + type: boolean + example: false + walletToPayFeeFrom: + type: string + description: if provided, this wallet will be used to pay fees instead of the primary wallet diff --git a/openapi/components/schemas/wallets/SpendRequestPayload-v2.yaml b/openapi/components/schemas/wallets/SpendRequestPayload-v2.yaml new file mode 100644 index 0000000..0fdce00 --- /dev/null +++ b/openapi/components/schemas/wallets/SpendRequestPayload-v2.yaml @@ -0,0 +1,37 @@ +type: object +required: + - toCurrency + - toAddress + - amount +properties: + toAddress: + description: Address where client wants to send funds to + type: string + example: 'mtxASJZHNmGeUPQ3DxLvJeKja6Lh7TcJM9' + toCurrency: + description: currency Id of the beneficiary wallet + type: string + example: '6' + amount: + description: transaction amount in simple crypto units + type: string + example: '9900000' + blockchainFeeOverride: + description: Used for overriding the system suggested blockchain fee (within 10% range) to manage the transaction processing speed + type: number + example: '0.0003234' + memo: + description: user-defined note for the funds withdrawal + type: string + receiverPaysFee: + description: | + When set to true, the receiver of the transaction will pay the fees. In this case, + the AmountInSmallestUnits will be deducted from the source balance, and the receiver will receive the remaining amount after deducting the fees. + When set to false (or not provided), the fees will be added to the AmountInSmallestUnits, + and the total sum (including fees) will be deducted from the source balance. + The receiver will receive the AmountInSmallestUnits exactly as specified. + type: boolean + example: false + walletToPayFeeFrom: + type: string + description: if provided, this wallet will be used to pay fees instead of the primary wallet diff --git a/openapi/components/schemas/wallets/WalletTransactionObj-v1.yaml b/openapi/components/schemas/wallets/WalletTransactionObj-v1.yaml new file mode 100644 index 0000000..30b4676 --- /dev/null +++ b/openapi/components/schemas/wallets/WalletTransactionObj-v1.yaml @@ -0,0 +1,152 @@ +type: object +description: wallet transaction details +properties: + id: + description: Id of the transaction in the system + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + dateCreated: + description: Date when transaction was created + type: string + example: '2022-10-05T08:39:41.494Z' + dateCompleted: + description: Date when transaction was received or sent to the chain + type: string + example: '2022-10-05T08:40:41.494Z' + fromOwnerId: + description: Id of the owner of the wallet who sent the transaction + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + fromWalletId: + description: Id of the wallet where the transaction was sent from + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + toWalletId: + description: Id of the wallet where the transaction was sent to + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + spendRequestId: + description: Id of the spend request which was used to create this transaction + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + fromCurrencyId: + description: Id of the currency that was used to send this transaction + type: integer + example: 1 + toCurrencyId: + description: Id of the currency of receipt for this transaction + type: integer + example: 2 + fromAmount: + description: Amount of funds that was sent in this transaction in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.22390234' + toAmount: + description: Amount of funds that was received in this transaction in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.13448434' + coinpaymentsFee: + description: Amount of funds withheld as system fee for this transaction in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.000012' + transactionStatus: + description: Status of this transaction. Possible values are + 'created' - CPS initiated withdrawal tx processing. Tx is not on the blockchain yet; + 'pending' - CPS detected transaction on the blockchain. Transaction waits to receive required number of confirmations; + 'completed' - CPS puts tx on chain. Tx can be detected in the blockchain mempool. Or an internal withdrawal is completed; + 'confirmedOnBlockchain' - Tx received all required confirmations on the blockchain, withdrawal/deposit is completed; + 'pendingReceive' - CPS waits for incoming deposit. Tx is on chain, waiting for required amount of confirmations; + 'failedOnBlockchain' - transaction has not received required amount of confirmations + # - 'unknown'; + # - 'processing' - + # - 'cancelled'; + # - 'rejected' + # - 'expired'; + # - 'failed' + type: string + example: 'created' + transactionType: + description: Type of this transaction. Possible values are 'unknown', 'internalReceive', 'utxoExternalReceive', + 'accountBasedExternalReceive', 'externalSpend', 'internalSpend', 'sameUserSpend', 'sameUserReceive', + 'accountBasedExternalTokenReceive', 'accountBasedTokenSpend', 'conversion', 'compensation', 'sweeping', + 'sweepingFunding', 'migratedAddressUtxoExternalReceive', 'migratedAddressAccountBasedExternalReceive', + 'migratedAddressAccountBasedExternalTokenReceive', 'autoSweeping', 'receiveTestFundsFromPool', 'returnTestFundsToPool' + type: string + example: 'externalSpend' + memo: + description: User-defined custom note for this transaction + type: string + example: 'July rent' + fromAddress: + description: Address of the wallet which was used when this transaction was created. For deposit transactions, this + is the address that is sending the funds (if available) + type: string + example: '1AYASDI34W2W2SIFFRE32452S1Q' + toAddress: + description: Address where this transaction is sending funds to + type: string + example: '1AYASDI34W2W2SIFFRE32452S1Q' + txHash: + description: Blockchain transaction hash (only for external transfers) + type: string + example: '1AYASDI34W2W2SIFFRE32452S1Q3289y7debugDSDSd38d3xSSA33ASDRxw98' + outputIndex: + description: Index of the output where this transaction receives funds (only for UTXO deposit transactions) + type: integer + example: 1 + blockchainFee: + description: Amount of funds spent as a blockchain fee for this transaction in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.00000032' + fromContractAddress: + description: Address of the sender contract if this transaction is an ERC20 or similar token transfer + type: string + example: '0xdac17f958d2ee523a2206206994597c13d831ec7' + toContractAddress: + description: Address of the reciever contract, if this transaction is an ERC20 or similar token transfer + type: string + example: '0xdac17f958d2ee523a2206206994597c13d831ec7' + blockchainFeeCurrency: + type: string + description: Currency in which blockchain network fees were deducted. The format is {CurrencyId}:{ContractAddress?} where ContractAddress is optional e.g.null "1", "4:0xdac17f958d2ee523a2206206994597c13d831ec7" + coinPaymentsFeeCurrency: + type: string + description: >- + Currency in which CoinPayments fee was deducted. The format is + {CurrencyId}:{ContractAddress?} where ContractAddress is optional e.g.null + "1", "4:0xdac17f958d2ee523a2206206994597c13d831ec7" + blockNumberTxAppearedAt: + description: block number where the transaction appeared on the blockchain + type: integer + supportTransactionId: + type: string + description: support Id of the transaction in CoinPayments system + confirmations: + description: Current number of confirmations that this transaction has on the blockchain + type: number + example: 2 + requiredConfirmations: + description: Required number of confirmations on the blockchain to consider this transaction confirmed + type: number + example: 5 + fromAmountNative: + type: string + description: amount sent in native transaction currency + toAmountNative: + type: string + description: amount received in native transaction currency + coinpaymentsFeeNative: + type: string + description: CoinPayments service fee in native transaction currency + blockchainFeeNative: + type: string + description: blockchain network fee in native transaction currency + isInvoicePaymentSend: + type: boolean + description: flag indicating if this transaction is a payment of the invoice + paymentType: + type: string + description: type of payment that transaction covers + convertedTxHash: + type: string + description: hash of the source transaction in case current transaction is part of the conversion operation diff --git a/openapi/components/schemas/wallets/WalletTransactionObj-v2.yaml b/openapi/components/schemas/wallets/WalletTransactionObj-v2.yaml new file mode 100644 index 0000000..4a0fc69 --- /dev/null +++ b/openapi/components/schemas/wallets/WalletTransactionObj-v2.yaml @@ -0,0 +1,162 @@ +type: object +description: wallet transaction details +properties: + id: + description: Id of the transaction in the system + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + dateCreated: + description: Date when transaction was created + type: string + example: '2022-10-05T08:39:41.494Z' + dateCompleted: + description: Date when transaction was received or sent to the chain + type: string + example: '2022-10-05T08:40:41.494Z' + fromOwnerId: + description: Id of the owner of the wallet who sent the transaction + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + fromWalletId: + description: Id of the wallet where the transaction was sent from + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + toWalletId: + description: Id of the wallet where the transaction was sent to + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + spendRequestId: + description: Id of the spend request which was used to create this transaction + type: string + example: '3fa85f64-5717-4562-b3fc-2c963f66afa6' + fromCurrencyId: + description: Id of the currency that was used to send this transaction + type: string + example: '1' + fromCurrencySymbol: + type: string + description: symbol of the currency that was used to send this transaction + toCurrencyId: + description: Id of the currency of receipt for this transaction + type: string + example: '2' + toCurrencySymbol: + type: string + description: symbol of the currency of receipt for this transaction + fromAmount: + description: Amount of funds that was sent in this transaction in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.22390234' + toAmount: + description: Amount of funds that was received in this transaction in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.13448434' + coinpaymentsFee: + description: Amount of funds withheld as system fee for this transaction in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.000012' + coinPaymentsFeeCurrency: + type: string + description: Currency in which CoinPayments fee was deducted. The format is + {CurrencyId}:{ContractAddress?} where ContractAddress is optional e.g.null + "1", "4:0xdac17f958d2ee523a2206206994597c13d831ec7" + coinPaymentsFeeCurrencySymbol: + type: string + description: symbol of the CoinPayments service fee currency + blockchainFee: + description: Amount of funds spent as a blockchain fee for this transaction in smallest units (e.g. Satoshis for Bitcoin) + type: string + example: '0.00000032' + blockchainFeeCurrency: + type: string + description: Currency in which blockchain network fees were deducted. The format is {CurrencyId}:{ContractAddress?} + where ContractAddress is optional e.g.null "1", "4:0xdac17f958d2ee523a2206206994597c13d831ec7" + blockchainFeeCurrencySymbol: + type: string + description: symbol of the blockchain fee currency + transactionStatus: + description: Status of this transaction. Possible values are + 'created' - CPS initiated withdrawal tx processing. Tx is not on the blockchain yet; + 'pending' - CPS detected transaction on the blockchain. Transaction waits to receive required number of confirmations; + 'completed' - CPS puts tx on chain. Tx can be detected in the blockchain mempool. Or an internal withdrawal is completed; + 'confirmedOnBlockchain' - Tx received all required confirmations on the blockchain, withdrawal/deposit is completed; + 'pendingReceive' - CPS waits for incoming deposit. Tx is on chain, waiting for required amount of confirmations; + 'failedOnBlockchain' - transaction has not received required amount of confirmations +# - 'unknown'; +# - 'processing' - +# - 'cancelled'; +# - 'rejected' +# - 'expired'; +# - 'failed' + type: string + example: 'created' + transactionType: + description: Type of this transaction. Possible values are 'unknown', 'internalReceive', 'utxoExternalReceive', + 'accountBasedExternalReceive', 'externalSpend', 'internalSpend', 'sameUserSpend', 'sameUserReceive', + 'accountBasedExternalTokenReceive', 'accountBasedTokenSpend', 'conversion', 'compensation', 'sweeping', + 'sweepingFunding', 'migratedAddressUtxoExternalReceive', 'migratedAddressAccountBasedExternalReceive', + 'migratedAddressAccountBasedExternalTokenReceive', 'autoSweeping', 'receiveTestFundsFromPool', 'returnTestFundsToPool' + type: string + example: 'externalSpend' + memo: + description: User-defined custom note for this transaction + type: string + example: 'July rent' + fromAddress: + description: Address of the wallet which was used when this transaction was created. For deposit transactions, this + is the address that is sending the funds (if available) + type: string + example: '1AYASDI34W2W2SIFFRE32452S1Q' + toAddress: + description: Address where this transaction is sending funds to + type: string + example: '1AYASDI34W2W2SIFFRE32452S1Q' + txHash: + description: Blockchain transaction hash (only for external transfers) + type: string + example: '1AYASDI34W2W2SIFFRE32452S1Q3289y7debugDSDSd38d3xSSA33ASDRxw98' + outputIndex: + description: Index of the output where this transaction receives funds (only for UTXO deposit transactions) + type: integer + example: 1 + blockNumberTxAppearedAt: + description: block number where the transaction appeared on the blockchain + type: integer + supportTransactionId: + type: string + description: support Id of the transaction in CoinPayments system + confirmations: + description: Current number of confirmations that this transaction has on the blockchain + type: integer + example: 2 + requiredConfirmations: + description: Required number of confirmations on the blockchain to consider this transaction confirmed + type: number + example: 5 + fromAmountNative: + type: string + description: amount sent in native transaction currency + toAmountNative: + type: string + description: amount received in native transaction currency + coinpaymentsFeeNative: + type: string + description: CoinPayments service fee in native transaction currency + blockchainFeeNative: + type: string + description: blockchain network fee in native transaction currency + nativeCurrency: + type: string + description: id of the native transaction currency + nativeCurrencySymbol: + type: string + description: symbol of the native transaction currency + isInvoicePaymentSend: + type: boolean + description: flag indicating if this transaction is a payment of the invoice + paymentType: + type: string + description: type of payment that transaction covers + convertedTxHash: + type: string + description: hash of the source transaction in case current transaction is part of the conversion operation diff --git a/openapi/components/schemas/wallets/arrayOfWalletTransactions-v1.yaml b/openapi/components/schemas/wallets/arrayOfWalletTransactions-v1.yaml new file mode 100644 index 0000000..460a823 --- /dev/null +++ b/openapi/components/schemas/wallets/arrayOfWalletTransactions-v1.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: './WalletTransactionObj-v1.yaml' diff --git a/openapi/components/schemas/wallets/arrayOfWalletTransactions-v2.yaml b/openapi/components/schemas/wallets/arrayOfWalletTransactions-v2.yaml new file mode 100644 index 0000000..3ff3ae4 --- /dev/null +++ b/openapi/components/schemas/wallets/arrayOfWalletTransactions-v2.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: './WalletTransactionObj-v2.yaml' diff --git a/openapi/components/schemas/wallets/arrayOfWallets-v1.yaml b/openapi/components/schemas/wallets/arrayOfWallets-v1.yaml new file mode 100644 index 0000000..e429020 --- /dev/null +++ b/openapi/components/schemas/wallets/arrayOfWallets-v1.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: './MerchantWalletObj-v1.yaml' diff --git a/openapi/components/schemas/wallets/arrayOfWallets-v2.yaml b/openapi/components/schemas/wallets/arrayOfWallets-v2.yaml new file mode 100644 index 0000000..8b44984 --- /dev/null +++ b/openapi/components/schemas/wallets/arrayOfWallets-v2.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: './MerchantWalletObj-v2.yaml' diff --git a/openapi/components/schemas/webhooks/webhookSchema.yaml b/openapi/components/schemas/webhooks/webhookSchema.yaml new file mode 100644 index 0000000..73044fe --- /dev/null +++ b/openapi/components/schemas/webhooks/webhookSchema.yaml @@ -0,0 +1,11 @@ +type: object +required: + - notificationsUrl + - notifications +properties: + notificationsUrl: + $ref: ../../globalTypes/notificationUrl.yaml + notifications: + $ref: ../../globalTypes/notifications.yaml + + diff --git a/openapi/components/securitySchemes/api_key.yaml b/openapi/components/securitySchemes/api_key.yaml new file mode 100644 index 0000000..359e56e --- /dev/null +++ b/openapi/components/securitySchemes/api_key.yaml @@ -0,0 +1,3 @@ +type: apiKey +in: header +name: api_key diff --git a/openapi/components/securitySchemes/basic_auth.yaml b/openapi/components/securitySchemes/basic_auth.yaml new file mode 100644 index 0000000..d016600 --- /dev/null +++ b/openapi/components/securitySchemes/basic_auth.yaml @@ -0,0 +1,2 @@ +type: http +scheme: basic diff --git a/openapi/components/securitySchemes/main_auth.yaml b/openapi/components/securitySchemes/main_auth.yaml new file mode 100644 index 0000000..a8ba56c --- /dev/null +++ b/openapi/components/securitySchemes/main_auth.yaml @@ -0,0 +1,7 @@ +type: oauth2 +flows: + implicit: + authorizationUrl: 'http://example.com/api/oauth/dialog' + scopes: + 'read:users': read users info + 'write:users': modify or remove users diff --git a/openapi/info-description-v1.md b/openapi/info-description-v1.md new file mode 100644 index 0000000..03f7ec7 --- /dev/null +++ b/openapi/info-description-v1.md @@ -0,0 +1,124 @@ +Welcome to CoinPayments API documentation! + +**This documentation applies to the New V2 Platform. If your dashboard matches the screenshot shown here, +please refer to the new platform documentation.** + +- **[Legacy CoinPayments API documentation](https://www.coinpayments.net/apidoc)** +- **[Legacy CoinPayments IPN (Webhook) Documentation](https://www.coinpayments.net/merchant-tools-ipn)** + +![markdown file changed](./legacy-dashboard.png) + +**IMPORTANT: This documentation contains the most recent versions of the public API endpoints.** + +**For all v2 endpoints the corresponding v1 versions are still operable and will not be deprecated. For the definition of the older +versions and custom endpoints, please, see [Extended CoinPayments API Documentation](https://extended-docs.coinpayments.com).** + +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**. + +# Overview +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](https://www.postman.com/coinpayments/workspace/coinpayments-api-collection-v2/collection/17606477-9f869b92-cfa1-4571-8b6b-ff57fa18d946?action=share&creator=28654468). +For information on authentication with the Postman collection, please, visit [this section](#section/Authentication-for-Postman). + +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. + +![markdown file changed](./free-ltct.png) + +# Features +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. + +#### Some of the key features of the website include: +1. Support for multiple popular cryptocurrencies, allowing customers to pay with the digital currency of their choice. +2. Processing and managing various transaction types: + - `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. +3. Generate invoices and manually share them with buyers through a link or via email. +4. Callback Addresses feature allows merchant to receive payment without specifying the amount or time in advance. +5. Real-time updates using Webhooks. The API provides updates on the status of transactions, allowing merchants and customers to track the progress of their payments. +6. Advanced security measures to ensure that all transactions are safe and secure. + +# Code Examples + +In this section you will find ready-made code examples for the most frequent use-cases. + +## Invoices + +See examples of how to create invoices with CPS API: + +- [create invoice in PHP using CPS v2 API](https://github.com/CoinPaymentsCom/Examples/blob/main/src/examples/api_v2/create_invoice.php) +- [create invoice in C# using CPS v2 API](https://github.com/CoinPaymentsCom/Examples/blob/cs_invoice_v2/dotnet/Examples/ExampleApp/ExampleCreator/v2/InvoiceV2ExampleCreator.cs) + +## Webhooks + +### Withdrawals and Deposits + +See our C# example of a [webhook for a deposit transaction](https://github.com/CoinPaymentsCom/Examples/blob/cs_prod_callback/dotnet/Examples/ExampleApp/Program.cs). + +Also, see how to prove the authentication of the webhook received from CPS [here](https://github.com/CoinPaymentsCom/Examples/blob/cs_prod_callback/dotnet/Examples/ExampleApp/Services/CallbackService.cs). + +### Invoices + +[Here](https://github.com/CoinPaymentsCom/Examples/blob/main/src/examples/webhook_processing.php) you can find an example +of how to check all the available webhook subscriptions for invoices and prove their authentication in PHP. + +## Network Fees + +See [this C# V2 API example](https://github.com/CoinPaymentsCom/Examples/blob/cs_blockchain_fee_v2/dotnet/Examples/ExampleApp/Program.cs) +to learn how to check the current blockchain network fee for a particular cryptocurrency. + +# Common API Errors +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. + +### Unauthorized +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. + +### Insufficient Funds +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. + +### Invalid Address +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 + + +#### Valid UTXO-Based Coin Addresses: +- Bitcoin (BTC): `1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2` +- Bitcoin Cash (BCH): `bitcoincash:qr7uq7uvujmzhcv29tw92q0hs7fwpht4fvl4a4kj9a` +- Litecoin (LTC): `LZx9pzGfH6mKSzVsJZnryeVrRzt6X8uZ9r` + +#### Valid Token Coin Addresses: +- Ethereum (ETH): `0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf` +- ERC-20 Tokens (e.g., DAI, USDT): `0x6B175474E89094C44Da98b954EedeAC495271d0F` + + +### Invalid or Unsupported Currency: +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. + +### Bad request ( Input validation errors ): +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. + + +# Rate limits +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. diff --git a/openapi/info-description-v2.md b/openapi/info-description-v2.md new file mode 100644 index 0000000..f94d3eb --- /dev/null +++ b/openapi/info-description-v2.md @@ -0,0 +1,150 @@ +Welcome to CoinPayments API documentation! + +**This documentation applies to the New V2 Platform. If your dashboard matches the screenshot shown here, +please refer to the new platform documentation.** + +- **[Legacy CoinPayments API documentation](https://www.coinpayments.net/apidoc)** +- **[Legacy CoinPayments IPN (Webhook) Documentation](https://www.coinpayments.net/merchant-tools-ipn)** + +![markdown file changed](./legacy-dashboard.png) + +**IMPORTANT: This documentation is an extended version of CoinPayments public API definition and contains all the supported versions +of the public API endpoints, specifically:** +- **all of the released endpoint versions;** +- **some custom endpoints for specific integration use-cases.** + +**For the concise documentation with only most recent endpoint versions, please, see +[reduced CoinPayments API Documentation](https://docs.coinpayments.com).** + +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. + +# Overview +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](https://www.postman.com/coinpayments/workspace/coinpayments-api-collection-v2/collection/17606477-9f869b92-cfa1-4571-8b6b-ff57fa18d946?action=share&creator=28654468). +For information on authentication with the Postman collection, please, visit [this section](#section/Authentication-for-Postman). + +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. + +![markdown file changed](./free-ltct.png) + +# Features +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. + +#### Some of the key features of the website include: +1. Support for multiple popular cryptocurrencies, allowing customers to pay with the digital currency of their choice. +2. Processing and managing various transaction types: + - `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. +3. Generate invoices and manually share them with buyers through a link or via email. +4. Callback Addresses feature allows merchant to receive payment without specifying the amount or time in advance. +5. Real-time updates using Webhooks. The API provides updates on the status of transactions, allowing merchants and customers to track the progress of their payments. +6. Advanced security measures to ensure that all transactions are safe and secure. + +# Code Examples + +In this section you will find ready-made code examples for the most frequent use-cases. + +## Invoices + +See examples of how to create invoices with CPS API: + +- [create invoice in PHP using CPS v1 API](https://github.com/CoinPaymentsCom/Examples/blob/main/src/examples/api_v1/create_invoice.php) +- [create invoice in PHP using CPS v2 API](https://github.com/CoinPaymentsCom/Examples/blob/main/src/examples/api_v2/create_invoice.php) +- [create invoice in C# using CPS v1 API](https://github.com/CoinPaymentsCom/Examples/blob/cs_prod_callback/dotnet/Examples/ExampleApp/ExampleCreator/ExampleCreator.cs) +- [create invoice in C# using CPS v2 API](https://github.com/CoinPaymentsCom/Examples/blob/cs_invoice_v2/dotnet/Examples/ExampleApp/ExampleCreator/v2/InvoiceV2ExampleCreator.cs) + +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](https://github.com/CoinPaymentsCom/Examples/blob/main/src/examples/api_v1/create_invoice_with_address.php). +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](Invoices-API#section/Payment-Flow-for-Integrated-Checkout-with-White-Labeling). + +## Wallets + +Learn how to create wallets with [this PHP V1 API example](https://github.com/CoinPaymentsCom/Examples/blob/main/src/examples/api_v1/create_wallet.php). + +Then [see this example](https://github.com/CoinPaymentsCom/Examples/blob/main/src/examples/api_v1/two_wallets.php) to learn +how to send money between your wallets. + +## Webhooks + +### Withdrawals and Deposits + +See our C# example of a [webhook for a deposit transaction](https://github.com/CoinPaymentsCom/Examples/blob/cs_prod_callback/dotnet/Examples/ExampleApp/Program.cs). + +Also, see how to prove the authentication of the webhook received from CPS [here](https://github.com/CoinPaymentsCom/Examples/blob/cs_prod_callback/dotnet/Examples/ExampleApp/Services/CallbackService.cs). + +### Invoices + +[Here](https://github.com/CoinPaymentsCom/Examples/blob/main/src/examples/webhook_processing.php) you can find an example +of how to check all the available webhook subscriptions for invoices and prove their authentication in PHP. + +## Rates + +With [this C# V1 API example](https://github.com/CoinPaymentsCom/Examples/blob/cs_prod_usdRate/dotnet/Examples/ExampleApp/Program.cs) +you can learn how to check the conversion rate for a specific fiat amount to crypto. + +## Network Fees + +See [this C# V2 API example](https://github.com/CoinPaymentsCom/Examples/blob/cs_blockchain_fee_v2/dotnet/Examples/ExampleApp/Program.cs) +to learn how to check the current blockchain network fee for a particular cryptocurrency. + +# Common API Errors +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. + +### Unauthorized +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. + +### Insufficient Funds +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. + +### Invalid Address +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 + + +#### Valid UTXO-Based Coin Addresses: +- Bitcoin (BTC): `1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2` +- Bitcoin Cash (BCH): `bitcoincash:qr7uq7uvujmzhcv29tw92q0hs7fwpht4fvl4a4kj9a` +- Litecoin (LTC): `LZx9pzGfH6mKSzVsJZnryeVrRzt6X8uZ9r` + +#### Valid Token Coin Addresses: +- Ethereum (ETH): `0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf` +- ERC-20 Tokens (e.g., DAI, USDT): `0x6B175474E89094C44Da98b954EedeAC495271d0F` + + +### Invalid or Unsupported Currency: +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. + +### Bad request ( Input validation errors ): +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. + + + +# Rate limits +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. diff --git a/openapi/openapi-2.yaml b/openapi/openapi-2.yaml new file mode 100644 index 0000000..a2e650d --- /dev/null +++ b/openapi/openapi-2.yaml @@ -0,0 +1,195 @@ +openapi: 3.1.0 +info: + version: '' + title: CoinPayments API Documentation + x-logo: + url: ./logo-2.png + description: + $ref: ./info-description-v2.md + license: + name: Apache 2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: Authentication + description: + $ref: './paths/auth/auth-v1.md' + - name: Access API + description: "API for managing clients access rights" + - name: Currencies API + description: + $ref: './paths/currencies/currencies-description-v1.md' + - name: Rates API + description: "API for rates supported by CoinPayments" + - name: Fees API + description: "API for current network fee for currencies" + - name: Wallets API + description: + $ref: './paths/wallets/wallets-description-v1.md' + - name: Invoices API + description: + $ref: './paths/invoices/invoice-description.md' + - name: Invoice Webhooks API + description: + $ref: './paths/webhooks/webhooks.md' + +servers: + - url: 'https://api.coinpayments.com/api' + +paths: + + #Access + '/v1/merchant/clients/access-control': + $ref: 'paths/access/access-control-v1.yaml' + + # Currencies + '/v1/currencies': + $ref: 'paths/currencies/get-currencies-v1.yaml' + '/v2/currencies': + $ref: 'paths/currencies/get-currencies-v2.yaml' + '/v1/currencies/{id}': + $ref: 'paths/currencies/get-currency-by-id-v1.yaml' + '/v2/currencies/{id}': + $ref: 'paths/currencies/get-currency-by-id-v2.yaml' + '/v1/currencies/blockchain-nodes/{id}/latest-block-number': + $ref: 'paths/currencies/get-latest-block-number-v1.yaml' + '/v2/currencies/blockchain-nodes/{id}/latest-block-number': + $ref: 'paths/currencies/get-latest-block-number-v2.yaml' + '/v1/currencies/required-confirmations': + $ref: 'paths/currencies/required-confirmations-v1.yaml' + '/v2/currencies/required-confirmations': + $ref: 'paths/currencies/required-confirmations-v2.yaml' + '/v1/currencies/conversions': + $ref: 'paths/currencies/conversions-v1.yaml' + '/v2/currencies/conversions': + $ref: 'paths/currencies/conversions-v2.yaml' + '/v1/currencies/limits/{fromCurrencyId}/{toCurrencyId}': + $ref: 'paths/currencies/limits-v1.yaml' + '/v2/currencies/limits/{fromCurrency}/{toCurrency}': + $ref: 'paths/currencies/limits-v2.yaml' + + # Fees + '/v1/fees/blockchain/{currency}': + $ref: 'paths/fees/blockchain-fee-v1.yaml' + '/v2/fees/blockchain/{currency}': + $ref: 'paths/fees/blockchain-fee-v2.yaml' + + # Invoices + '/v1/merchant/invoices': + $ref: 'paths/invoices/invoices-v1.yaml' + '/v2/merchant/invoices': + $ref: 'paths/invoices/invoices-v2.yaml' + '/v1/merchant/invoices/buy-now-button': + $ref: 'paths/invoices/create-buy-button-v1.yaml' + '/v2/merchant/invoices/buy-now-button': + $ref: 'paths/invoices/create-buy-button-v2.yaml' + '/v1/invoices/{id}/payment-currencies/{currencyId}': + $ref: 'paths/invoices/get-payment-address.yaml' + '/v1/invoices/{id}/payment-currencies/{currencyId}/status': + $ref: 'paths/invoices/get-payment-status.yaml' + '/v1/merchant/invoices/{id}': + $ref: 'paths/invoices/get-by-id-v1.yaml' + '/v2/merchant/invoices/{id}': + $ref: 'paths/invoices/get-by-id-v2.yaml' + '/v1/merchant/invoices/{id}/payouts': + $ref: 'paths/invoices/payouts-v1.yaml' + '/v2/merchant/invoices/{id}/payouts': + $ref: 'paths/invoices/payouts-v2.yaml' + '/v1/merchant/invoices/{id}/history': + $ref: 'paths/invoices/history-v1.yaml' + '/v2/merchant/invoices/{id}/history': + $ref: 'paths/invoices/history-v2.yaml' + + # Wallets + '/v1/merchant/wallets/your-server-url': + $ref: 'paths/wallets/wallet-webhook-payload-v1.yaml' + '/v2/merchant/wallets/your-server-url': + $ref: 'paths/wallets/wallet-webhook-payload-v2.yaml' + '/v1/merchant/wallets': + $ref: 'paths/wallets/create-wallet-v1.yaml' + '/v2/merchant/wallets': + $ref: 'paths/wallets/create-wallet-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}': + $ref: 'paths/wallets/get-wallet-by-id-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}': + $ref: 'paths/wallets/get-wallet-by-id-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/webhook': + $ref: 'paths/wallets/update-wallet-webhook-url-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/webhook': + $ref: 'paths/wallets/update-wallet-webhook-url-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/addresses': + $ref: 'paths/wallets/create-and-get-addresses-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/addresses': + $ref: 'paths/wallets/create-and-get-addresses-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/addresses/{addressIdStr}': + $ref: 'paths/wallets/get-address-by-id-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/addresses/{addressIdStr}': + $ref: 'paths/wallets/get-address-by-id-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/addresses/{addressIdStr}/webhook': + $ref: 'paths/wallets/update-address-webhook-url-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/addresses/{addressIdStr}/webhook': + $ref: 'paths/wallets/update-address-webhook-url-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/transactions': + $ref: 'paths/wallets/get-wallet-transactions-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/transactions': + $ref: 'paths/wallets/get-wallet-transactions-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/transaction': + $ref: 'paths/wallets/get-wallet-transaction-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/transaction': + $ref: 'paths/wallets/get-wallet-transaction-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/consolidation/{toWalletIdStr}': + $ref: 'paths/wallets/create-wallet-consolidation-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/consolidation/{toWalletIdStr}': + $ref: 'paths/wallets/create-wallet-consolidation-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/consolidation': + $ref: 'paths/wallets/get-wallet-consolidation-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/consolidation': + $ref: 'paths/wallets/get-wallet-consolidation-v2.yaml' + '/v1/merchant/wallets/consolidation-preview': + $ref: 'paths/wallets/create-wallets-consolidation-preview-v1.yaml' + '/v2/merchant/wallets/consolidation-preview': + $ref: 'paths/wallets/create-wallets-consolidation-preview-v2.yaml' + '/v1/merchant/wallets/consolidation/{toWalletIdStr}': + $ref: 'paths/wallets/create-wallets-consolidation-v1.yaml' + '/v2/merchant/wallets/consolidation/{toWalletIdStr}': + $ref: 'paths/wallets/create-wallets-consolidation-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/spend/request': + $ref: 'paths/wallets/spend-request-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/spend/request': + $ref: 'paths/wallets/spend-request-v2.yaml' + '/v1/merchant/wallets/{walletIdStr}/spend/confirmation': + $ref: 'paths/wallets/spend-request-confirmation-v1.yaml' + '/v2/merchant/wallets/{walletIdStr}/spend/confirmation': + $ref: 'paths/wallets/spend-request-confirmation-v2.yaml' + + # Clients + '/v1/merchant/your-server-url': + $ref: 'paths/webhooks/webhook-payload.yaml' + '/v1/merchant/clients/{clientId}/webhooks': + $ref: 'paths/webhooks/webhook.yaml' + '/v1/merchant/clients/{clientId}/webhooks/{webhookId}': + $ref: 'paths/webhooks/update-delete.yaml' + + # Rates + '/v1/rates': + $ref: 'paths/rates/rates-v1.yaml' + '/v2/rates': + $ref: 'paths/rates/rates-v2.yaml' + + +components: + securitySchemes: + main_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://example.com/api/oauth/dialog' + scopes: + 'read:users': read users info + 'write:users': modify or remove users + api_key: + type: apiKey + in: header + name: api_key + basic_auth: + type: http + scheme: basic \ No newline at end of file diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml new file mode 100644 index 0000000..0f11a9d --- /dev/null +++ b/openapi/openapi.yaml @@ -0,0 +1,133 @@ +openapi: 3.1.0 +info: + version: '' + title: CoinPayments API Documentation + x-logo: + url: ./logo.png + description: + $ref: ./info-description-v1.md + license: + name: Apache 2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: Authentication + description: + $ref: './paths/auth/auth-v2.md' + - name: Currencies API + description: + $ref: './paths/currencies/currencies-description-v2.md' + - name: Rates API + description: "API for rates supported by CoinPayments" + - name: Fees API + description: "API for current network fee for currencies" + - name: Wallets API + description: + $ref: './paths/wallets/wallets-description-v2.md' + - name: Invoices API + description: + $ref: './paths/invoices/invoice-description.md' + - name: Invoice Webhooks API + description: + $ref: './paths/webhooks/webhooks.md' + +servers: + - url: 'https://api.coinpayments.com/api' + +paths: + + # Currencies + '/v2/currencies': + $ref: 'paths/currencies/get-currencies-v2.yaml' + '/v2/currencies/{id}': + $ref: 'paths/currencies/get-currency-by-id-v2.yaml' + '/v2/currencies/blockchain-nodes/{id}/latest-block-number': + $ref: 'paths/currencies/get-latest-block-number-v2.yaml' + '/v2/currencies/required-confirmations': + $ref: 'paths/currencies/required-confirmations-v2.yaml' + '/v2/currencies/conversions': + $ref: 'paths/currencies/conversions-v2.yaml' + '/v2/currencies/limits/{fromCurrency}/{toCurrency}': + $ref: 'paths/currencies/limits-v2.yaml' + + # Fees + '/v2/fees/blockchain/{currency}': + $ref: 'paths/fees/blockchain-fee-v2.yaml' + + # Invoices + '/v2/merchant/invoices': + $ref: 'paths/invoices/invoices-v2.yaml' + '/v2/merchant/invoices/buy-now-button': + $ref: 'paths/invoices/create-buy-button-v2.yaml' + '/v1/invoices/{id}/payment-currencies/{currencyId}': + $ref: 'paths/invoices/get-payment-address.yaml' + '/v1/invoices/{id}/payment-currencies/{currencyId}/status': + $ref: 'paths/invoices/get-payment-status.yaml' + '/v2/merchant/invoices/{id}': + $ref: 'paths/invoices/get-by-id-v2.yaml' + '/v2/merchant/invoices/{id}/payouts': + $ref: 'paths/invoices/payouts-v2.yaml' + '/v2/merchant/invoices/{id}/history': + $ref: 'paths/invoices/history-v2.yaml' + + # Wallets + '/v2/merchant/wallets/your-server-url': + $ref: 'paths/wallets/wallet-webhook-payload-v2.yaml' + '/v2/merchant/wallets': + $ref: 'paths/wallets/create-wallet-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}': + $ref: 'paths/wallets/get-wallet-by-id-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/webhook': + $ref: 'paths/wallets/update-wallet-webhook-url-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/addresses': + $ref: 'paths/wallets/create-and-get-addresses-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/addresses/{addressIdStr}': + $ref: 'paths/wallets/get-address-by-id-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/addresses/{addressIdStr}/webhook': + $ref: 'paths/wallets/update-address-webhook-url-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/transactions': + $ref: 'paths/wallets/get-wallet-transactions-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/transaction': + $ref: 'paths/wallets/get-wallet-transaction-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/consolidation/{toWalletIdStr}': + $ref: 'paths/wallets/create-wallet-consolidation-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/consolidation': + $ref: 'paths/wallets/get-wallet-consolidation-v2.yaml' + '/v2/merchant/wallets/consolidation-preview': + $ref: 'paths/wallets/create-wallets-consolidation-preview-v2.yaml' + '/v2/merchant/wallets/consolidation/{toWalletIdStr}': + $ref: 'paths/wallets/create-wallets-consolidation-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/spend/request': + $ref: 'paths/wallets/spend-request-v2.yaml' + '/v2/merchant/wallets/{walletIdStr}/spend/confirmation': + $ref: 'paths/wallets/spend-request-confirmation-v2.yaml' + + # Clients + '/v1/merchant/your-server-url': + $ref: 'paths/webhooks/webhook-payload.yaml' + '/v1/merchant/clients/{clientId}/webhooks': + $ref: 'paths/webhooks/webhook.yaml' + '/v1/merchant/clients/{clientId}/webhooks/{webhookId}': + $ref: 'paths/webhooks/update-delete.yaml' + + # Rates + '/v2/rates': + $ref: 'paths/rates/rates-v2.yaml' + + +components: + securitySchemes: + main_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://example.com/api/oauth/dialog' + scopes: + 'read:users': read users info + 'write:users': modify or remove users + api_key: + type: apiKey + in: header + name: api_key + basic_auth: + type: http + scheme: basic \ No newline at end of file diff --git a/openapi/paths/.external-conversions.yaml.icloud b/openapi/paths/.external-conversions.yaml.icloud new file mode 100644 index 0000000..9678aef Binary files /dev/null and b/openapi/paths/.external-conversions.yaml.icloud differ diff --git a/openapi/paths/README.md b/openapi/paths/README.md new file mode 100644 index 0000000..9b58a85 --- /dev/null +++ b/openapi/paths/README.md @@ -0,0 +1,107 @@ +# Paths + +Organize your path definitions within this folder. You will reference your paths from your main `openapi.yaml` entrypoint file. + +It may help you to adopt some conventions: + +* path separator token (e.g. `_`) or subfolders +* path parameter (e.g. `{example}`) +* file-per-path or file-per-operation + +There are different benefits and drawbacks to each decision. + +You can adopt any organization you wish. We have some tips for organizing paths based on common practices. + +## Each path in a separate file + +Use a predefined "path separator" and keep all of your path files in the top level of the `paths` folder. + +``` +├── echo.yaml +├── path-item-with-examples.yaml +├── path-item.yaml +└── users_{username}.yaml +``` + +Redocly recommends using the `_` character for this case. + +In addition, Redocly recommends placing path parameters within `{}` curly braces if you adopt this style. + +#### Motivations + +* Quickly see a list of all paths. Many people think in terms of the "number" of "endpoints" (paths), and not the "number" of "operations" (paths * http methods). + +* Only the "file-per-path" option is semantically correct with the OpenAPI Specification 3.0.2. However, Redocly's openapi-cli will build valid bundles for any of the other options too. + + +#### Drawbacks + +* This may require multiple definitions per http method within a single file. +* It requires settling on a path separator (that is allowed to be used in filenames) and sticking to that convention. + +## Each operation in a separate file + +You may also place each operation in a separate file. + +In this case, if you want all paths at the top-level, you can concatenate the http method to the path name. Similar to the above option, you can + +### Files at top-level of `paths` + +You may name your files with some concatenation for the http method. For example, following a convention such as: `-.yaml`. + +#### Motivations + +* Quickly see all operations without needing to navigate subfolders. + +#### Drawbacks + +* Adopting an unusual path separator convention, instead of using subfolders. + +### Use subfolders to mirror API path structure + +Example: +``` +GET /customers + +/paths/customers/get.yaml +``` + +In this case, the path id defined within subfolders which mirror the API URL structure. + +Example with path parameter: +``` +GET /customers/{id} + +/paths/customers/{id}/get.yaml +``` + +#### Motivations + +It matches the URL structure. + +It is pretty easy to reference: + +```yaml +paths: + '/customers/{id}': + get: + $ref: ./paths/customers/{id}/get.yaml + put: + $ref: ./paths/customers/{id}/put.yaml +``` + +#### Drawbacks + +If you have a lot of nested folders, it may be confusing to reference your schemas. + +Example +``` +file: /paths/customers/{id}/timeline/{messageId}/get.yaml + +# excerpt of file + headers: + Rate-Limit-Remaining: + $ref: ../../../../../components/headers/Rate-Limit-Remaining.yaml + +``` +Notice the `../../../../../` in the ref which requires some attention to formulate correctly. While openapi-cli has a linter which suggests possible refs when there is a mistake, this is still a net drawback for APIs with deep paths. diff --git a/openapi/paths/access/access-control-v1.yaml b/openapi/paths/access/access-control-v1.yaml new file mode 100644 index 0000000..65cd2b7 --- /dev/null +++ b/openapi/paths/access/access-control-v1.yaml @@ -0,0 +1,38 @@ +post: + tags: + - Access API + summary: Create Access V1 + description: | + Request to create access level for merchant's admins + operationId: createAccessV1 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/access/acl-v1.yaml + description: Create access to manage operations via API for merchant's admins + responses: + '200': + description: Success. + '401': + description: Not Authorized + '403': + description: Forbidden +get: + tags: + - Access API + summary: Get Access V1 + description: | + Get list of merchant's admins' rights to manage operations via API + operationId: getAccessV1 + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/schemas/access/acl-v1.yaml + '401': + description: Not Authorized + '403': + description: Forbidden diff --git a/openapi/paths/auth/auth-v1.md b/openapi/paths/auth/auth-v1.md new file mode 100644 index 0000000..390b7b5 --- /dev/null +++ b/openapi/paths/auth/auth-v1.md @@ -0,0 +1,184 @@ +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](Currencies-API), [Rates API](Rates-API) and [Fees API](Fees-API) endpoints do not require authorization. + +#### Prerequisites +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. + + +## Create Credentials +First, you need to [create an account](https://vip.coinpayments.com/Identity/Account/SignUp). + +Then [log into your account](https://vip.coinpayments.com/Identity/Account/Welcome). + +##### Once you're logged into your account, click on Integrations 👇 + +![markdown file changed](./integrations-1.png) + + +##### API integrations 🏗 +![markdown file changed](./integration-2.png) + + +##### Add integration ➕ +![markdown file changed](./integration-3.png) + + +##### Give a name and a URL to your integration - more on the URL later. +![markdown file changed](./integration-4.png) + + + +**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. + +--- + +## Generate API Signature +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. + +--- + +### X-CoinPayments-Client +Populate this header with your `clientId`. + +Example value +`cc7caaa431d54ad6accfd28b20170ee4` + + +--- +### X-CoinPayments-Timestamp +Before we Populate this header with the current time as a UNIX timestamp, exclude the milliseconds epoch, example: + +```javascript +const date = new Date().toISOString().split(".")[0]; +``` + +Example value: +`2022-12-19T19:27:04` +--- +### Construct the request queryString +To create an API signature, you first need to construct the query string which is made of the +following attributes concatenated together +* method +* url +* clientId +* date + +Example ( Javascript ) +```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 ) +```javascript +const queryString = `ufeff${method}${url}${clientId}${date}${''}`; +``` + +--- +### X-CoinPayments-Signature +Next step is to use your `clientSecret` to generate the signature using SHA-256 encryption algorithm as follows: + +```javascript +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: +```javascript +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); +``` + +--- + +## Authentication for Postman + +When setting up authentication with Postman to test out our [API collection](https://coinpayments.postman.co/workspace/Team-Workspace~09eaa205-3e67-47b7-86d7-1d5709bf0610/collection/28654468-da626518-a5d1-44ac-ab0b-d59e23d051dc?action=share&creator=28654468&active-environment=28654468-0e4b6fab-4efd-4c74-a76e-d21527672c78), +follow these steps: + +1. Set up environment variables: + - Use **https://api.coinpayments.com/api/** as `baseUrl`. + - Provide your `clientID` and `clientSecret` from your [API integration](/#section/Create-Credentials). + +![markdown file changed](./postman-1.png) + +2. Provide the following script in the collection **Pre-request Script** section: + +--- +```javascript +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 +}) +``` + +--- +![markdown file changed](./postman-2.png) \ No newline at end of file diff --git a/openapi/paths/auth/auth-v2.md b/openapi/paths/auth/auth-v2.md new file mode 100644 index 0000000..c93fa0f --- /dev/null +++ b/openapi/paths/auth/auth-v2.md @@ -0,0 +1,184 @@ +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](#tag/Currencies-API), [Rates API](#tag/Rates-API) and [Fees API](#tag/Fees-API) endpoints do not require authorization. + +#### Prerequisites +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. + + +## Create Credentials +First, you need to [create an account](https://vip.coinpayments.com/Identity/Account/SignUp). + +Then [log into your account](https://vip.coinpayments.com/Identity/Account/Welcome). + +##### Once you're logged into your account, click on Integrations 👇 + +![markdown file changed](./integrations-1.png) + + +##### API integrations 🏗 +![markdown file changed](./integration-2.png) + + +##### Add integration ➕ +![markdown file changed](./integration-3.png) + + +##### Give a name and a URL to your integration - more on the URL later. +![markdown file changed](./integration-4.png) + + + +**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. + +--- + +## Generate API Signature +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. + +--- + +### X-CoinPayments-Client +Populate this header with your `clientId`. + +Example value +`cc7caaa431d54ad6accfd28b20170ee4` + + +--- +### X-CoinPayments-Timestamp +Before we Populate this header with the current time as a UNIX timestamp, exclude the milliseconds epoch, example: + +```javascript +const date = new Date().toISOString().split(".")[0]; +``` + +Example value: +`2022-12-19T19:27:04` +--- +### Construct the request queryString +To create an API signature, you first need to construct the query string which is made of the +following attributes concatenated together +* method +* url +* clientId +* date + +Example ( Javascript ) +```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 ) +```javascript +const queryString = `ufeff${method}${url}${clientId}${date}${''}`; +``` + +--- +### X-CoinPayments-Signature +Next step is to use your `clientSecret` to generate the signature using SHA-256 encryption algorithm as follows: + +```javascript +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: +```javascript +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); +``` + +--- + +## Authentication for Postman + +When setting up authentication with Postman to test out our [API collection](https://coinpayments.postman.co/workspace/Team-Workspace~09eaa205-3e67-47b7-86d7-1d5709bf0610/collection/28654468-da626518-a5d1-44ac-ab0b-d59e23d051dc?action=share&creator=28654468&active-environment=28654468-0e4b6fab-4efd-4c74-a76e-d21527672c78), +follow these steps: + +1. Set up environment variables: + - Use **https://api.coinpayments.com/api/** as `baseUrl`. + - Provide your `clientID` and `clientSecret` from your [API integration](/#section/Create-Credentials). + +![markdown file changed](./postman-1.png) + +2. Provide the following script in the collection **Pre-request Script** section: + +--- +```javascript +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 +}) +``` + +--- +![markdown file changed](./postman-2.png) \ No newline at end of file diff --git a/openapi/paths/conversion/send-convert-confirmation.yaml b/openapi/paths/conversion/send-convert-confirmation.yaml new file mode 100644 index 0000000..41951f7 --- /dev/null +++ b/openapi/paths/conversion/send-convert-confirmation.yaml @@ -0,0 +1,27 @@ +post: + tags: + - Conversion API + summary: Confirm conversion + description: Send a request to confirm converting funds from the wallet + operationId: ConvertRequestConfirmation + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the Id of the wallet you want to convert funds from. Reminder; this field is included in the response returned + from the first ( Send convert request ) + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/conversion/convertRequestConfirmation.yaml + '400': + description: Bad Request + + + diff --git a/openapi/paths/conversion/send-convert-request.yaml b/openapi/paths/conversion/send-convert-request.yaml new file mode 100644 index 0000000..6395bd8 --- /dev/null +++ b/openapi/paths/conversion/send-convert-request.yaml @@ -0,0 +1,40 @@ +post: + tags: + - Conversion API + summary: Convert between cryptocurrencies + description: | + Similar to the create withdrawal flow, Converting from a coin to another two-step process: + + 1- Send convert 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 conversion: This step is straightforward, the confirm Conversion endpoint expects the "spendRequestId" + as a URL param to identify, confirm and publish the transaction. + **Note**: The "spendRequestId" included in the response from the first step. + operationId: convertCoins + requestBody: + content: + application/json: + schema: + $ref: ../../components/conversion/sendConvertRequest.yaml + description: Convert Request payload + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the Id of the wallet you want to convert funds from + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/conversion/convertRequestSuccess.yaml + '400': + description: Bad Request + + diff --git a/openapi/paths/currencies/conversions-v1.yaml b/openapi/paths/currencies/conversions-v1.yaml new file mode 100644 index 0000000..540af9d --- /dev/null +++ b/openapi/paths/currencies/conversions-v1.yaml @@ -0,0 +1,18 @@ +get: + tags: + - Currencies API + summary: Gets a list of all possible currency conversions V1 + description: | + Gets a list of all possible currency conversions + operationId: getCurrencyConversionsV1 + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/currencyConversions-v1.yaml + '400': + description: Bad request + + diff --git a/openapi/paths/currencies/conversions-v2.yaml b/openapi/paths/currencies/conversions-v2.yaml new file mode 100644 index 0000000..d55703d --- /dev/null +++ b/openapi/paths/currencies/conversions-v2.yaml @@ -0,0 +1,18 @@ +get: + tags: + - Currencies API + summary: Gets a list of all possible currency conversions V2 + description: | + Gets a list of all possible currency conversions + operationId: getCurrencyConversionsV2 + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/currencyConversions-v2.yaml + '400': + description: Bad request + + diff --git a/openapi/paths/currencies/currencies-description-v1.md b/openapi/paths/currencies/currencies-description-v1.md new file mode 100644 index 0000000..6b69d61 --- /dev/null +++ b/openapi/paths/currencies/currencies-description-v1.md @@ -0,0 +1,21 @@ +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](/#operation/createMerchantWalletV1). + +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](/#operation/sendSpendRequestV1). + +Below, you will find the detailed information on currency-related endpoints and their field values. + diff --git a/openapi/paths/currencies/currencies-description-v2.md b/openapi/paths/currencies/currencies-description-v2.md new file mode 100644 index 0000000..ecfe031 --- /dev/null +++ b/openapi/paths/currencies/currencies-description-v2.md @@ -0,0 +1,21 @@ +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](/#operation/createMerchantWalletV2). + +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](/#operation/sendSpendRequestV2). + +Below, you will find the detailed information on currency-related endpoints and their field values. + diff --git a/openapi/paths/currencies/get-currencies-v1.yaml b/openapi/paths/currencies/get-currencies-v1.yaml new file mode 100644 index 0000000..f4f57da --- /dev/null +++ b/openapi/paths/currencies/get-currencies-v1.yaml @@ -0,0 +1,39 @@ +get: + tags: + - Currencies API + summary: List currencies and their capabilities V1 + description: Returns a page of the supported currencies on the CoinPayments.com platform, by default ordered by their rank on CoinPayments.com. + operationId: listPlatformSupportedCurrenciesV1 + parameters: + - name: q + in: query + schema: + type: string + example: 'BTC' + description: search query to find currencies by name or symbol + - name: types + in: query + schema: + type: array + example: 'crypto, token, fiat' + description: comma separated list of the types of currencies to return (e.g. 'coin', 'token', 'fiat', etc.). By default currencies of all types are returned + - name: capabilities + in: query + schema: + type: array + example: 'payments, singleSigAccounts, utxo, pooledAccounts' + description: search query to find currencies by capability. "payments" is for currencies in which payments can be received. + "singleSigAccounts" is for currencies supported by singleSig accounts. "utxo" is for UTXO currencies, otherwise + the currency is an account-based currency. "pooledAccounts" means the currency is using pooled accounts in CoinPayments. + Mainly such currency is an account-based currency and by default the addresses of merchant wallets for such + currency will be temporary. For these currencies it is possible to create wallets with permanent addresses, if requested explicitly + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/arrayOfCurrencies.yaml + '400': + description: Bad Request + diff --git a/openapi/paths/currencies/get-currencies-v2.yaml b/openapi/paths/currencies/get-currencies-v2.yaml new file mode 100644 index 0000000..f3c5433 --- /dev/null +++ b/openapi/paths/currencies/get-currencies-v2.yaml @@ -0,0 +1,42 @@ +get: + tags: + - Currencies API + summary: List currencies and their capabilities V2 + description: Returns a page of the supported currencies on the CoinPayments.com platform, by default ordered by their rank on CoinPayments.com. + operationId: listPlatformSupportedCurrenciesV2 + parameters: + - name: q + in: query + schema: + type: string + example: 'BTC' + description: search query to find currencies by name or symbol + - name: types + in: query + schema: + type: array + example: 'crypto, token, fiat' + description: comma separated list of the types of currencies to return (e.g. 'coin', 'token', 'fiat', etc.). By default currencies of all types are returned + - name: capabilities + in: query + schema: + type: array + example: 'payments, singleSigAccounts, utxo, pooledAccounts' + description: search query to find currencies by capability. "payments" is for currencies in which payments can be received. + "singleSigAccounts" is for currencies supported by singleSig accounts. "utxo" is for UTXO currencies, otherwise + the currency is an account-based currency. "pooledAccounts" means the currency is using pooled accounts in CoinPayments. + Mainly such currency is an account-based currency and by default the addresses of merchant wallets for such + currency will be temporary. For these currencies it is possible to create wallets with permanent addresses, if requested explicitly + x-badges: + - name: 'V2' + - position: before + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/arrayOfCurrencies.yaml + '400': + description: Bad Request + diff --git a/openapi/paths/currencies/get-currency-by-id-v1.yaml b/openapi/paths/currencies/get-currency-by-id-v1.yaml new file mode 100644 index 0000000..cf060fe --- /dev/null +++ b/openapi/paths/currencies/get-currency-by-id-v1.yaml @@ -0,0 +1,25 @@ +get: + tags: + - Currencies API + summary: Get currency by Id V1 + description: Get currency information by currency Id in the CoinPayments system + operationId: getCurrencyByIdV1 + parameters: + - name: id + in: path + required: true + schema: + type: string + description: currency id or symbol + example: '2' + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/currencySchema.yaml + '404': + description: currency not found + + diff --git a/openapi/paths/currencies/get-currency-by-id-v2.yaml b/openapi/paths/currencies/get-currency-by-id-v2.yaml new file mode 100644 index 0000000..b48f67e --- /dev/null +++ b/openapi/paths/currencies/get-currency-by-id-v2.yaml @@ -0,0 +1,25 @@ +get: + tags: + - Currencies API + summary: Get currency by Id V2 + description: Get currency information by currency Id in the CoinPayments system + operationId: getCurrencyByIdV2 + parameters: + - name: id + in: path + required: true + schema: + type: string + description: currency id or symbol + example: '2' + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/currencySchema.yaml + '404': + description: currency not found + + diff --git a/openapi/paths/currencies/get-latest-block-number-v1.yaml b/openapi/paths/currencies/get-latest-block-number-v1.yaml new file mode 100644 index 0000000..00408f9 --- /dev/null +++ b/openapi/paths/currencies/get-latest-block-number-v1.yaml @@ -0,0 +1,25 @@ +get: + tags: + - Currencies API + summary: Get latest block number by currency V1 + description: | + Get the latest blockchain block number by currency Id + operationId: getLatestBlockNumberByCurrencyIdV1 + parameters: + - name: id + in: path + required: true + schema: + type: string + example: '1' + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/latest-block-number.yaml + '400': + description: Bad request + + diff --git a/openapi/paths/currencies/get-latest-block-number-v2.yaml b/openapi/paths/currencies/get-latest-block-number-v2.yaml new file mode 100644 index 0000000..40ba94b --- /dev/null +++ b/openapi/paths/currencies/get-latest-block-number-v2.yaml @@ -0,0 +1,25 @@ +get: + tags: + - Currencies API + summary: Get latest block number by currency V2 + description: | + Get the latest blockchain block number by currency Id + operationId: getLatestBlockNumberByCurrencyIdV2 + parameters: + - name: id + in: path + required: true + schema: + type: string + example: '1' + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/latest-block-number.yaml + '400': + description: Bad request + + diff --git a/openapi/paths/currencies/limits-v1.yaml b/openapi/paths/currencies/limits-v1.yaml new file mode 100644 index 0000000..23d351b --- /dev/null +++ b/openapi/paths/currencies/limits-v1.yaml @@ -0,0 +1,33 @@ +get: + tags: + - Currencies API + summary: Gets minimum and maximum amounts for currency conversions V1 + description: | + Gets minimum and maximum amounts for a conversion pair in the "from" currency + operationId: getCurrencyConversionsLimitsV1 + parameters: + - name: fromCurrencyId + in: path + required: true + schema: + type: string + example: 55 + description: the Id of the source currency of conversion + - name: toCurrencyId + in: path + required: true + schema: + type: string + example: 41 + description: the Id of the destination currency of conversion + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/currencyConversionLimits.yaml + '400': + description: Bad request + + diff --git a/openapi/paths/currencies/limits-v2.yaml b/openapi/paths/currencies/limits-v2.yaml new file mode 100644 index 0000000..51a473d --- /dev/null +++ b/openapi/paths/currencies/limits-v2.yaml @@ -0,0 +1,33 @@ +get: + tags: + - Currencies API + summary: Gets minimum and maximum amounts for currency conversions V2 + description: | + Gets minimum and maximum amounts for a conversion pair in the "from" currency + operationId: getCurrencyConversionsLimitsV2 + parameters: + - name: fromCurrency + in: path + required: true + schema: + type: string + example: 55 + description: the Id of the source currency of conversion + - name: toCurrency + in: path + required: true + schema: + type: string + example: 41 + description: the Id of the destination currency of conversion + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/currencyConversionLimits.yaml + '400': + description: Bad request + + diff --git a/openapi/paths/currencies/required-confirmations-v1.yaml b/openapi/paths/currencies/required-confirmations-v1.yaml new file mode 100644 index 0000000..eab5e4c --- /dev/null +++ b/openapi/paths/currencies/required-confirmations-v1.yaml @@ -0,0 +1,16 @@ +get: + tags: + - Currencies API + summary: Get the required confirmations for each currency V1 + description: | + Get required confirmations for each currency. + operationId: getRequiredConfirmationsForEachCurrencyV1 + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/requiredConfirmations-v1.yaml + '400': + description: Bad request diff --git a/openapi/paths/currencies/required-confirmations-v2.yaml b/openapi/paths/currencies/required-confirmations-v2.yaml new file mode 100644 index 0000000..9fec95d --- /dev/null +++ b/openapi/paths/currencies/required-confirmations-v2.yaml @@ -0,0 +1,16 @@ +get: + tags: + - Currencies API + summary: Get the required confirmations for each currency V2 + description: | + Get required confirmations for each currency. + operationId: getRequiredConfirmationsForEachCurrencyV2 + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/schemas/currencies/requiredConfirmations-v2.yaml + '400': + description: Bad request diff --git a/openapi/paths/fees/blockchain-fee-v1.yaml b/openapi/paths/fees/blockchain-fee-v1.yaml new file mode 100644 index 0000000..e38c3c3 --- /dev/null +++ b/openapi/paths/fees/blockchain-fee-v1.yaml @@ -0,0 +1,20 @@ +get: + tags: + - Fees API + summary: Returns currency and its current network fee on the blockchain V1 + description: Returns a currency supported on the CoinPayments.com platform with its current network fee on the blockchain. + operationId: currencyBlockchainFeeV1 + parameters: + - name: currency + in: path + required: true + schema: + type: string + description: currency id + responses: + '200': + description: Ok - blockchain fee for the currency in the smallest units + '401': + description: Unauthorized + '403': + description: Forbidden \ No newline at end of file diff --git a/openapi/paths/fees/blockchain-fee-v2.yaml b/openapi/paths/fees/blockchain-fee-v2.yaml new file mode 100644 index 0000000..9d7ef43 --- /dev/null +++ b/openapi/paths/fees/blockchain-fee-v2.yaml @@ -0,0 +1,20 @@ +get: + tags: + - Fees API + summary: Returns currency and its current network fee on the blockchain V2 + description: Returns a currency supported on the CoinPayments.com platform with its current network fee on the blockchain. + operationId: currencyBlockchainFeeV2 + parameters: + - name: currency + in: path + required: true + schema: + type: string + description: currency id + responses: + '200': + description: Ok - blockchain fee for the currency + '401': + description: Unauthorized + '403': + description: Forbidden \ No newline at end of file diff --git a/openapi/paths/invoices/create-buy-button-v1.yaml b/openapi/paths/invoices/create-buy-button-v1.yaml new file mode 100644 index 0000000..07515e7 --- /dev/null +++ b/openapi/paths/invoices/create-buy-button-v1.yaml @@ -0,0 +1,22 @@ +post: + tags: + - Invoices API + summary: Create Buy-Now Button V1 + description: | + 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 + operationId: createBuyNowButtonV1 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/buy-now-button-v1.yaml + description: Create Buy-Now Button + responses: + '200': + description: Success. + '401': + description: Not Authorized + '403': + description: Forbidden diff --git a/openapi/paths/invoices/create-buy-button-v2.yaml b/openapi/paths/invoices/create-buy-button-v2.yaml new file mode 100644 index 0000000..536ac78 --- /dev/null +++ b/openapi/paths/invoices/create-buy-button-v2.yaml @@ -0,0 +1,22 @@ +post: + tags: + - Invoices API + summary: Create Buy-Now Button V2 + description: | + 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 + operationId: createBuyNowButtonV2 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/buy-now-button-v2.yaml + description: Create Buy-Now Button + responses: + '200': + description: Success. + '401': + description: Not Authorized + '403': + description: Forbidden diff --git a/openapi/paths/invoices/get-by-id-v1.yaml b/openapi/paths/invoices/get-by-id-v1.yaml new file mode 100644 index 0000000..ee549ed --- /dev/null +++ b/openapi/paths/invoices/get-by-id-v1.yaml @@ -0,0 +1,26 @@ +get: + tags: + - Invoices API + summary: Get invoice by Id V1 + description: | + Get Invoice by Id + operationId: getInvoiceByIdV1 + parameters: + - name: id + in: path + required: true + schema: + type: string + description: invoice id + example: 6472ac8d-b913-4c7e-9186-a7cc48a48f73 + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/responses/invoices/invoiceByIdRes-v1.yaml + '400': + description: Bad request example! + + diff --git a/openapi/paths/invoices/get-by-id-v2.yaml b/openapi/paths/invoices/get-by-id-v2.yaml new file mode 100644 index 0000000..fae6757 --- /dev/null +++ b/openapi/paths/invoices/get-by-id-v2.yaml @@ -0,0 +1,26 @@ +get: + tags: + - Invoices API + summary: Get invoice by Id V2 + description: | + Get Invoice by Id + operationId: getInvoiceByIdV2 + parameters: + - name: id + in: path + required: true + schema: + type: string + description: invoice id + example: 6472ac8d-b913-4c7e-9186-a7cc48a48f73 + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/responses/invoices/invoiceByIdRes-v2.yaml + '400': + description: Bad request example! + + diff --git a/openapi/paths/invoices/get-payment-address.yaml b/openapi/paths/invoices/get-payment-address.yaml new file mode 100644 index 0000000..b2d30b0 --- /dev/null +++ b/openapi/paths/invoices/get-payment-address.yaml @@ -0,0 +1,36 @@ +get: + tags: + - Invoices API + summary: Get payment address by currency id + description: | + 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. + operationId: getPaymentAddressByCurrencyId + parameters: + - name: id + in: path + required: true + schema: + type: string + description: Id of the invoice + - name: currencyId + in: path + required: true + schema: + type: string + description: currency Id + example: '2' + responses: + '200': + description: Success status code (200) - + Address for buyer to make payment with indication of currency, amount, and expiration timer + content: + application/json: + schema: + $ref: ../../components/responses/invoices/address-by-currency-v1.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + + diff --git a/openapi/paths/invoices/get-payment-status.yaml b/openapi/paths/invoices/get-payment-status.yaml new file mode 100644 index 0000000..7812ac3 --- /dev/null +++ b/openapi/paths/invoices/get-payment-status.yaml @@ -0,0 +1,34 @@ +get: + tags: + - Invoices API + summary: Get payment status once payment is made + description: | + 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. + operationId: getPaymentStatus + parameters: + - name: id + in: path + required: true + schema: + type: string + description: Id of the invoice + - name: currencyId + in: path + required: true + schema: + type: string + example: '2' + responses: + '200': + description: Success status code ( 200 ) - Status of the invoice + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/payment-status.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + + diff --git a/openapi/paths/invoices/history-v1.yaml b/openapi/paths/invoices/history-v1.yaml new file mode 100644 index 0000000..0a27277 --- /dev/null +++ b/openapi/paths/invoices/history-v1.yaml @@ -0,0 +1,22 @@ +get: + tags: + - Invoices API + summary: Get invoice history V1 + description: | + List history events of an invoice by the invoice Id + operationId: getInvoiceHistoryV1 + parameters: + - name: id + in: path + required: true + schema: + $ref: ../../components/globalTypes/id.yaml + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/invoiceHistory.yaml + '404': + description: Merchant Not Found! \ No newline at end of file diff --git a/openapi/paths/invoices/history-v2.yaml b/openapi/paths/invoices/history-v2.yaml new file mode 100644 index 0000000..0c0eea6 --- /dev/null +++ b/openapi/paths/invoices/history-v2.yaml @@ -0,0 +1,22 @@ +get: + tags: + - Invoices API + summary: Get invoice history V2 + description: | + List history events of an invoice by the invoice Id + operationId: getInvoiceHistoryV2 + parameters: + - name: id + in: path + required: true + schema: + $ref: ../../components/globalTypes/id.yaml + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/invoiceHistory.yaml + '404': + description: Merchant Not Found! \ No newline at end of file diff --git a/openapi/paths/invoices/invoice-description.md b/openapi/paths/invoices/invoice-description.md new file mode 100644 index 0000000..b36c647 --- /dev/null +++ b/openapi/paths/invoices/invoice-description.md @@ -0,0 +1,235 @@ +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: +1. Create invoice links for payment collection. +2. Build custom white label checkout solutions for your business. +3. Create buy-now buttons for quick buyers' checkout. +CoinPayment’s invoices API is built around “invoice” entity. In other words, under the hood it generates an invoice with +all the buyer’s and merchant’s data plus information on the product/service. Thus, merchants will be flexible in +managing payments with the help of this data via a set of available endpoints. + +Below you will find information on how payment flow is organized for each of the above-mentioned approaches. + +## Payment Flow for Invoice Links + +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: + +1. Merchant adds details on services for which invoice is issued, indicates user’s details like name, payment address +and email, if provided. +2. With the help of createInvoice endpoint merchant generates an invoice entity with the data from step 1. +3. As a response to the createInvoice endpoint, merchant receives: + - an invoice Id to further check invoice status + - a link to the invoice document with the active payment button that would lead user to payment checkout. + +*Note:* In order this request could work properly, merchant must make sure to eliminate the following attribute from the +request: + +```json + "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. + +4. Invoice is added to merchant's account transaction history where merchant will be able to track payment status. +5. Merchant sends out the link to the invoice to the buyer. +6. Buyer enters their email for potential refunds, selects the currency for payment. +7. The buyer is presented with a payment address, total amount of cryptocurrency to-be-deposited, and a timer within which +the transaction has to be completed. +8. At the same time currency of payment is reflected in the transaction details of the payment in the merchant's +transaction history. +9. Additionally, if the merchant has [webhooks](/#tag/Invoice-Webhooks-API) set-up, CoinPayments will be sending invoice payment +notifications for each status change thereof (e.g. invoiceCreated, invoicePending, invoicePaid, invoiceCompleted, +invoiceCancelled, invoiceTimedOut). + +## Payment Flow for Integrated Checkout with White Labeling + +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: + +1. Buyer selects product/service on the merchant’s site and adds them to the shopping cart. At the checkout, buyer +indicates their details like name, payment address and email and clicks "Pay". +2. By clicking "Pay", buyer launches the payment flow. In this flow, buyer's email provided when creating the order, +is recorded as the 'RefundEmail' in the 'creteInvoice' request for possible refunds in case of over- and underpayment. +``` +{ + ... + "Payment": { + "RefundEmail": "jane_doe@hotmail.com" + } +} +``` + +At the same time, the 'createInvoice' endpoint generates an invoice entity including: +- 'invoiceId' to get payment address and check payment status +- list of available currencies for payment with currency description, payment amount and fees +- payment expiration timestamp. + +3. If merchant wants to allow buyer to select currency at checkout, payment address is obtained with the help of +'getPaymentAddressByCurrency' endpoint, once buyer chooses the currency for payment. If merchant's website has preset +currency for all goods and services, the same endpoint must be triggered at step 2., once buyer clicks "Pay". As a result, buyer is +presented with the following data: +- a currency id +- a payment address +- total amount of the selected cryptocurrency to be deposited +- timer for completing the transaction. + +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. + +![markdown file changed](./invoice-checkout.png) + +4. After that merchant can check the status of the payment with the help of getPaymentStatus endpoint that includes: + - status of payment + - how much was detected and confirmed on blockchain + - how much was detected but not confirmed yet. +5. Additionally, if the merchant has [webhooks](/#tag/Invoice-Webhooks-API) set-up, CoinPayments will be sending payment + notifications for each status change (e.g. invoiceCreated, invoicePending, invoicePaid, invoiceCompleted, + invoiceCancelled, invoiceTimedOut). + +### QR Code Generation + +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: + +--- +```javascript + +
    + + + +``` +--- + +## Payment Flow for Integrated Checkout with Buy-Now Button + +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: + +1. Buyer detects product/service on the merchant’s site and wants to order them immediately, so they click on the "Pay + with CoinPayments" button next to the product/service. +2. By clicking "Pay with CoinPayments", buyer launches the payment flow. As a first step of the flow, buyer is requested + to provide their email. The email is recorded as the 'RefundEmail' in the creteInvoice request for possible refunds + in case of over- and underpayment. + At the same time, the createInvoice endpoint generates an invoice entity including: +- invoiceId to get payment address and check payment status +- list of available currencies for payment with currency description, payment amount and fees +- payment expiration timestamp. +3. If merchant wants to allow buyer to select currency at checkout, payment address is obtained with the help of + getPaymentAddressByCurrency endpoint, once buyer chooses the currency for payment. If merchant's website has preset + currency for all goods and services, the same endpoint must be triggered once buyer clicks "Pay". As a result, buyer is + presented with a payment address, total amount of the selected cryptocurrency to be deposited, and a timer within which + the transaction has to be completed. +4. After that merchant can check the status of the payment with the help of 'getPaymentStatus' endpoint that includes: +- status of payment +- how much was detected and confirmed on blockchain +- how much was detected but not confirmed yet. +5. Additionally, if the merchant has [webhooks](/#tag/Invoice-Webhooks-API) set-up, CoinPayments will be sending payment + notifications for each status change (e.g. invoiceCreated, invoicePending, invoicePaid, invoiceCompleted, + invoiceCancelled, invoiceTimedOut). + +## Payment Settings + +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. + +![markdown file changed](./payouts.png) + + +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. \ No newline at end of file diff --git a/openapi/paths/invoices/invoices-v1.yaml b/openapi/paths/invoices/invoices-v1.yaml new file mode 100644 index 0000000..9be009e --- /dev/null +++ b/openapi/paths/invoices/invoices-v1.yaml @@ -0,0 +1,96 @@ +post: + tags: + - Invoices API + summary: Create Invoice V1 + description: | + 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 + operationId: createInvoiceV1 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/invoice-v1.yaml + description: Create Invoice + responses: + '200': + description: Success. + Invoice in all available currencies. **Note**, for Invoice Links flow, only "id" and "link" properties + are necessary + content: + application/json: + schema: + $ref: ../../components/responses/invoices/createInvoiceRes-v1.yaml + '401': + description: Not Authorized + '403': + description: Forbidden +get: + tags: + - Invoices API + summary: Get invoices V1 + description: | + Get list of merchant invoices + operationId: getListOfInvoicesV1 + parameters: + - name: status + in: query + schema: + type: string + example: draft, scheduled, unpaid, pending, paid, cancelled, completed, timedOut, deleted + description: optional status field to allow filtering by invoice status. + - name: from + in: query + schema: + type: string + example: 2023-01-01 + description: optional "from" field to allow filtering by invoice creation date. + - name: to + in: query + schema: + type: string + example: 2023-01-30 + description: optional "to" field to allow filtering by invoice creation date. + - name: q + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional search string to find invoices with these words. + - name: integration + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional integration field to allow filtering by integration. + - name: payoutWalletId + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional query to filter the invoices by the wallet they were paid out to (for 'paid' and 'completed' invoices). + - name: limit + in: query + schema: + type: integer + example: 10 + description: used to specify the number of records to return in one page. + - name: after + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: used to specify a cursor or marker that indicates the starting point of the next page of data. + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/invoices/invoices-v1.yaml + '404': + description: Merchant Not Found! + + + + diff --git a/openapi/paths/invoices/invoices-v2.yaml b/openapi/paths/invoices/invoices-v2.yaml new file mode 100644 index 0000000..99ddbd3 --- /dev/null +++ b/openapi/paths/invoices/invoices-v2.yaml @@ -0,0 +1,96 @@ +post: + tags: + - Invoices API + summary: Create Invoice V2 + description: | + 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 + operationId: createInvoiceV2 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/invoice-v2.yaml + description: Create Invoice + responses: + '200': + description: Success. + Invoice in all available currencies. **Note**, for Invoice Links flow, only "id" and "link" properties + are necessary + content: + application/json: + schema: + $ref: ../../components/responses/invoices/createInvoiceRes-v2.yaml + '401': + description: Not Authorized + '403': + description: Forbidden +get: + tags: + - Invoices API + summary: Get invoices V2 + description: | + Get list of merchant invoices + operationId: getListOfInvoicesV2 + parameters: + - name: status + in: query + schema: + type: string + example: draft, scheduled, unpaid, pending, paid, cancelled, completed, timedOut, deleted + description: optional status field to allow filtering by invoice status. + - name: from + in: query + schema: + type: string + example: 2023-01-01 + description: optional "from" field to allow filtering by invoice creation date. + - name: to + in: query + schema: + type: string + example: 2023-01-30 + description: optional "to" field to allow filtering by invoice creation date. + - name: q + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional search string to find invoices with these words. + - name: integration + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional integration field to allow filtering by integration. + - name: payoutWalletId + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: optional query to filter the invoices by the wallet they were paid out to (for 'paid' and 'completed' invoices). + - name: limit + in: query + schema: + type: integer + example: 10 + description: used to specify the number of records to return in one page. + - name: after + in: query + schema: + type: string + example: 9c2cbbb936824b9d91a1229321bfd03a + description: used to specify a cursor or marker that indicates the starting point of the next page of data. + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/invoices/invoices-v2.yaml + '404': + description: Merchant Not Found! + + + + diff --git a/openapi/paths/invoices/payouts-v1.yaml b/openapi/paths/invoices/payouts-v1.yaml new file mode 100644 index 0000000..c4519ec --- /dev/null +++ b/openapi/paths/invoices/payouts-v1.yaml @@ -0,0 +1,28 @@ +get: + tags: + - Invoices API + summary: Get invoices payouts V1 + description: | + 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. + + operationId: getInvoicePayoutsV1 + parameters: + - name: id + in: path + required: true + description: invoice Id + schema: + type: string + example: '5xyKTbjTMcbXMUsaprSRaP' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/payouts/payouts-v1.yaml + '404': + description: Merchant Not Found! + diff --git a/openapi/paths/invoices/payouts-v2.yaml b/openapi/paths/invoices/payouts-v2.yaml new file mode 100644 index 0000000..97370bc --- /dev/null +++ b/openapi/paths/invoices/payouts-v2.yaml @@ -0,0 +1,28 @@ +get: + tags: + - Invoices API + summary: Get invoices payouts V2 + description: | + 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. + + operationId: getInvoicePayoutsV2 + parameters: + - name: id + in: path + required: true + description: invoice Id + schema: + type: string + example: '5xyKTbjTMcbXMUsaprSRaP' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/schemas/invoices/payouts/payouts-v1.yaml + '404': + description: Merchant Not Found! + diff --git a/openapi/paths/merchant-callbacks.yaml b/openapi/paths/merchant-callbacks.yaml new file mode 100644 index 0000000..8c51651 --- /dev/null +++ b/openapi/paths/merchant-callbacks.yaml @@ -0,0 +1,31 @@ +post: + tags: + - Callbacks + summary: in progress + description: | + Operation description **Markdown**. + operationId: operationId + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/Schema.yaml + description: requestBody description + required: true + responses: + '200': + description: OK + headers: + X-Rate-Limit: + description: Calls per hour allowed by the user. + schema: + type: integer + format: int32 + X-Expires-After: + $ref: ../components/headers/ExpiresAfter.yaml + content: + application/json: + schema: + $ref: ../components/schemas/Schema.yaml + '400': + $ref: ../components/responses/Problem.yaml diff --git a/openapi/paths/path-item-with-examples.yaml b/openapi/paths/path-item-with-examples.yaml new file mode 100644 index 0000000..e86132c --- /dev/null +++ b/openapi/paths/path-item-with-examples.yaml @@ -0,0 +1,43 @@ +post: + tags: + - Merchant Callbacks + summary: Operation summary with examples + description: | + Operation description **markdown**. + operationId: postPathItemWithExamples + security: + - api_key: [] + - basic_auth: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/Schema.yaml + examples: + mapName: + summary: My first example + description: My first example's description. + value: + stringProperty: tada + mapNameDoesNotShowInDocsUnlessSummaryIsNotProvided: + value: + stringProperty: checkmark + description: requestBody description + required: true + responses: + '200': + description: OK + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + $ref: ../components/headers/ExpiresAfter.yaml + content: + application/json: + schema: + $ref: ../components/schemas/Schema.yaml + '400': + $ref: ../components/responses/Problem.yaml diff --git a/openapi/paths/rates/rates-v1.yaml b/openapi/paths/rates/rates-v1.yaml new file mode 100644 index 0000000..d1963ce --- /dev/null +++ b/openapi/paths/rates/rates-v1.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Rates API + summary: Conversion rates between currencies V1 + description: | + Returns the currency conversion rates for the specified from currencies converted to the specified to currencies. + operationId: getConversionsBetweenTwoCurrenciesV1 + parameters: + - name: from + schema: + type: string + in: query + description: comma separated list of currency ids to use as the source for rate calculations + required: true + example: 1 + - name: to + schema: + type: string + in: query + description: comma separated list of currency ids for which to retrieve conversion rates for (from the from currencies) + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/responses/rates/ratesRes-v1.yaml + '400': + description: Bad request + + diff --git a/openapi/paths/rates/rates-v2.yaml b/openapi/paths/rates/rates-v2.yaml new file mode 100644 index 0000000..93e58bb --- /dev/null +++ b/openapi/paths/rates/rates-v2.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Rates API + summary: Conversion rates between currencies V2 + description: | + Returns the currency conversion rates for the specified from currencies converted to the specified to currencies. + operationId: getConversionsBetweenTwoCurrenciesV2 + parameters: + - name: from + schema: + type: string + in: query + description: comma separated list of currency ids to use as the source for rate calculations + required: true + example: 1 + - name: to + schema: + type: string + in: query + description: comma separated list of currency ids for which to retrieve conversion rates for (from the from currencies) + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/responses/rates/ratesRes-v2.yaml + '400': + description: Bad request + + diff --git a/openapi/paths/remove.yaml b/openapi/paths/remove.yaml new file mode 100644 index 0000000..e072e79 --- /dev/null +++ b/openapi/paths/remove.yaml @@ -0,0 +1,30 @@ +post: + tags: + - Merchant Wallets + summary: Merchant wallets Test + description: Operation description **Markdown**. + operationId: createNewWallet + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/Schema.yaml + description: requestBody description + required: true + responses: + '200': + description: OK + headers: + X-Rate-Limit: + description: Calls per hour allowed by the user. + schema: + type: integer + format: int32 + X-Expires-After: + $ref: ../components/headers/ExpiresAfter.yaml + content: + application/json: + schema: + $ref: ../components/schemas/Schema.yaml + '400': + $ref: ../components/responses/Problem.yaml diff --git a/openapi/paths/wallets/create-and-get-addresses-v1.yaml b/openapi/paths/wallets/create-and-get-addresses-v1.yaml new file mode 100644 index 0000000..876264c --- /dev/null +++ b/openapi/paths/wallets/create-and-get-addresses-v1.yaml @@ -0,0 +1,81 @@ +post: + tags: + - Wallets API + summary: Create address for an existing wallet V1 + description: | + 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. + + operationId: createWalletAddressV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + requestBody: + content: + application/json: + schema: + type: object + properties: + label: + type: string + example: shop tests address + description: label for the address + notificationUrl: + type: string + description: when provided, CoinPayments API will be sending webhook notifications to this URL. + Overrides wallet notifications URL + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/wallets/addressRes.yaml + '401': + description: Unauthorized + '403': + description: Forbidden +get: + tags: + - Wallets API + summary: Get wallet addresses V1 + description: Retrieves a list of wallet addresses + operationId: getWalletAddressesV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: skip + in: query + required: false + schema: + type: integer + description: used for paging. The page is limited to 100 items. Number of addresses to skip before displaying the following batch of addresses + - name: take + in: query + required: false + schema: + type: integer + description: used for paging. The page is limited to 100 items. Number of addresses to display in the batch + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/responses/wallets/list-of-addresses.yaml + '404': + description: Wallet not found + + diff --git a/openapi/paths/wallets/create-and-get-addresses-v2.yaml b/openapi/paths/wallets/create-and-get-addresses-v2.yaml new file mode 100644 index 0000000..8d448e1 --- /dev/null +++ b/openapi/paths/wallets/create-and-get-addresses-v2.yaml @@ -0,0 +1,81 @@ +post: + tags: + - Wallets API + summary: Create address for an existing wallet V2 + description: | + 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. + + operationId: createWalletAddressV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + requestBody: + content: + application/json: + schema: + type: object + properties: + label: + type: string + example: shop tests address + description: label for the address + notificationUrl: + type: string + description: when provided, CoinPayments API will be sending webhook notifications to this URL. + Overrides wallet notifications URL + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/wallets/addressRes.yaml + '401': + description: Unauthorized + '403': + description: Forbidden +get: + tags: + - Wallets API + summary: Get wallet addresses V2 + description: Retrieves a list of wallet addresses + operationId: getWalletAddressesV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: skip + in: query + required: false + schema: + type: integer + description: used for paging. The page is limited to 100 items. Number of addresses to skip before displaying the following batch of addresses + - name: take + in: query + required: false + schema: + type: integer + description: used for paging. The page is limited to 100 items. Number of addresses to display in the batch + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/responses/wallets/list-of-addresses.yaml + '404': + description: Wallet not found + + diff --git a/openapi/paths/wallets/create-wallet-consolidation-v1.yaml b/openapi/paths/wallets/create-wallet-consolidation-v1.yaml new file mode 100644 index 0000000..9d53f49 --- /dev/null +++ b/openapi/paths/wallets/create-wallet-consolidation-v1.yaml @@ -0,0 +1,38 @@ +post: + tags: + - Wallets API + summary: Execute merchant wallet consolidation V1 + description: | + 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. + operationId: createWalletConsolidationV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: id of the wallet which funds are consolidated + - name: toWalletIdStr + in: path + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: id of the wallet where funds are sent for consolidation + - name: addressIds + in: query + schema: + type: string + description: comma-separated values of addresses from which funds are to be swept to the main wallet balance + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/wallets/consolidationRes.yaml + '401': + description: Unauthorized + '403': + description: Forbidden diff --git a/openapi/paths/wallets/create-wallet-consolidation-v2.yaml b/openapi/paths/wallets/create-wallet-consolidation-v2.yaml new file mode 100644 index 0000000..366b1af --- /dev/null +++ b/openapi/paths/wallets/create-wallet-consolidation-v2.yaml @@ -0,0 +1,38 @@ +post: + tags: + - Wallets API + summary: Execute merchant wallet consolidation V2 + description: | + 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. + operationId: createWalletConsolidationV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: id of the wallet which funds are consolidated + - name: toWalletIdStr + in: path + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: id of the wallet where funds are sent for consolidation + - name: addressIds + in: query + schema: + type: string + description: comma-separated values of addresses from which funds are to be swept to the main wallet balance + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/wallets/consolidationRes.yaml + '401': + description: Unauthorized + '403': + description: Forbidden diff --git a/openapi/paths/wallets/create-wallet-v1.yaml b/openapi/paths/wallets/create-wallet-v1.yaml new file mode 100644 index 0000000..f99d510 --- /dev/null +++ b/openapi/paths/wallets/create-wallet-v1.yaml @@ -0,0 +1,41 @@ +post: + tags: + - Wallets API + summary: Create wallet V1 + description: | + Creates new wallet by currency Id. Note: you can get the currency Id from the [Сurrencies API](/#tag/Currencies-API). + operationId: createMerchantWalletV1 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/MerchantWallet-v1.yaml + description: Create wallet payload + required: true + responses: + '202': + description: Success + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/NewWallet.yaml + '404': + description: Currency Not Found! +get: + tags: + - Wallets API + summary: Get Wallets V1 + description: Retrieves a list of wallets with their balances, addresses, statuses and other info. + operationId: getMerchantWalletsV1 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/arrayOfWallets-v1.yaml + '404': + description: Wallet not found + + + diff --git a/openapi/paths/wallets/create-wallet-v2.yaml b/openapi/paths/wallets/create-wallet-v2.yaml new file mode 100644 index 0000000..987d6b9 --- /dev/null +++ b/openapi/paths/wallets/create-wallet-v2.yaml @@ -0,0 +1,43 @@ +post: + tags: + - Wallets API + summary: Create wallet V2 + description: | + Creates new wallet by currency Id. Note: you can get the currency Id from the [Сurrencies API](/#tag/Currencies-API). + operationId: createMerchantWalletV2 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/MerchantWallet-v2.yaml + description: Create wallet payload + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/NewWallet.yaml + '401': + description: Unauthorized + '403': + description: Forbidden +get: + tags: + - Wallets API + summary: Get Wallets V2 + description: Retrieves a list of wallets with their balances, addresses, statuses and other info. + operationId: getMerchantWalletsV2 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/arrayOfWallets-v2.yaml + '404': + description: Wallet not found + + + diff --git a/openapi/paths/wallets/create-wallets-consolidation-preview-v1.yaml b/openapi/paths/wallets/create-wallets-consolidation-preview-v1.yaml new file mode 100644 index 0000000..642dabf --- /dev/null +++ b/openapi/paths/wallets/create-wallets-consolidation-preview-v1.yaml @@ -0,0 +1,27 @@ +post: + tags: + - Wallets API + summary: Execute merchant wallets consolidation preview V1 + description: | + 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. + operationId: createWalletsConsolidationPreviewV1 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/MerchantWalletsConsolidation.yaml + description: Create wallets consolidation preview + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/wallets/consolidationResWallets.yaml + '401': + description: Unauthorized + '403': + description: Forbidden \ No newline at end of file diff --git a/openapi/paths/wallets/create-wallets-consolidation-preview-v2.yaml b/openapi/paths/wallets/create-wallets-consolidation-preview-v2.yaml new file mode 100644 index 0000000..b8e0eab --- /dev/null +++ b/openapi/paths/wallets/create-wallets-consolidation-preview-v2.yaml @@ -0,0 +1,27 @@ +post: + tags: + - Wallets API + summary: Execute merchant wallets consolidation preview V2 + description: | + 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. + operationId: createWalletsConsolidationPreviewV2 + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/MerchantWalletsConsolidation.yaml + description: Create wallets consolidation preview + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/wallets/consolidationResWallets.yaml + '401': + description: Unauthorized + '403': + description: Forbidden \ No newline at end of file diff --git a/openapi/paths/wallets/create-wallets-consolidation-v1.yaml b/openapi/paths/wallets/create-wallets-consolidation-v1.yaml new file mode 100644 index 0000000..52ba7d7 --- /dev/null +++ b/openapi/paths/wallets/create-wallets-consolidation-v1.yaml @@ -0,0 +1,35 @@ +post: + tags: + - Wallets API + summary: Execute merchant wallets consolidation V1 + description: | + 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. + operationId: createWalletsConsolidationV1 + parameters: + - name: toWalletIdStr + in: path + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: id of the wallet where funds are sent for consolidation + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/MerchantWalletsConsolidation.yaml + description: Create wallets consolidation + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/wallets/consolidationResWallets.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + diff --git a/openapi/paths/wallets/create-wallets-consolidation-v2.yaml b/openapi/paths/wallets/create-wallets-consolidation-v2.yaml new file mode 100644 index 0000000..3412022 --- /dev/null +++ b/openapi/paths/wallets/create-wallets-consolidation-v2.yaml @@ -0,0 +1,35 @@ +post: + tags: + - Wallets API + summary: Execute merchant wallets consolidation V2 + description: | + 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. + operationId: createWalletsConsolidationV2 + parameters: + - name: toWalletIdStr + in: path + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: id of the wallet where funds are sent for consolidation + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/MerchantWalletsConsolidation.yaml + description: Create wallets consolidation + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/wallets/consolidationResWallets.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + diff --git a/openapi/paths/wallets/create-withdrawal-description.md b/openapi/paths/wallets/create-withdrawal-description.md new file mode 100644 index 0000000..4159e99 --- /dev/null +++ b/openapi/paths/wallets/create-withdrawal-description.md @@ -0,0 +1,18 @@ +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: + +![markdown file changed](./withdrawal-flowchart.png) \ No newline at end of file diff --git a/openapi/paths/wallets/get-address-by-id-v1.yaml b/openapi/paths/wallets/get-address-by-id-v1.yaml new file mode 100644 index 0000000..d19f6de --- /dev/null +++ b/openapi/paths/wallets/get-address-by-id-v1.yaml @@ -0,0 +1,34 @@ +get: + tags: + - Wallets API + summary: Get Address of the Wallet by Id V1 + description: Retrieves address by wallet and address Ids + operationId: getMerchantAddressByIdV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: addressIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the address Id + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/responses/wallets/addressByIdRes.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + + diff --git a/openapi/paths/wallets/get-address-by-id-v2.yaml b/openapi/paths/wallets/get-address-by-id-v2.yaml new file mode 100644 index 0000000..e8a756c --- /dev/null +++ b/openapi/paths/wallets/get-address-by-id-v2.yaml @@ -0,0 +1,34 @@ +get: + tags: + - Wallets API + summary: Get Address of the Wallet by Id V2 + description: Retrieves address by wallet and address Ids + operationId: getMerchantAddressByIdV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: addressIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the address Id + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/responses/wallets/addressByIdRes.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + + diff --git a/openapi/paths/wallets/get-wallet-by-id-v1.yaml b/openapi/paths/wallets/get-wallet-by-id-v1.yaml new file mode 100644 index 0000000..679acbf --- /dev/null +++ b/openapi/paths/wallets/get-wallet-by-id-v1.yaml @@ -0,0 +1,26 @@ +get: + tags: + - Wallets API + summary: Get Wallet by Id V1 + description: Retrieves wallet by its Id + operationId: getMerchantWalletByIdV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/MerchantWalletObj-v1.yaml + '404': + description: Wallet not found + # $ref: ../../components/responses/Problem.yaml + + diff --git a/openapi/paths/wallets/get-wallet-by-id-v2.yaml b/openapi/paths/wallets/get-wallet-by-id-v2.yaml new file mode 100644 index 0000000..dde6869 --- /dev/null +++ b/openapi/paths/wallets/get-wallet-by-id-v2.yaml @@ -0,0 +1,28 @@ +get: + tags: + - Wallets API + summary: Get Wallet by Id V2 + description: Retrieves wallet by its Id + operationId: getMerchantWalletByIdV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/MerchantWalletObj-v2.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + + + diff --git a/openapi/paths/wallets/get-wallet-consolidation-v1.yaml b/openapi/paths/wallets/get-wallet-consolidation-v1.yaml new file mode 100644 index 0000000..98842cf --- /dev/null +++ b/openapi/paths/wallets/get-wallet-consolidation-v1.yaml @@ -0,0 +1,36 @@ +get: + tags: + - Wallets API + summary: Get details of merchant wallet consolidation V1 + description: + 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. + operationId: getWalletConsolidationV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: addressIds + in: query + required: false + schema: + type: string + description: comma-separated values of addresses for which merchant wants to check details before executing sweep + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/responses/wallets/consolidationRes.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + + diff --git a/openapi/paths/wallets/get-wallet-consolidation-v2.yaml b/openapi/paths/wallets/get-wallet-consolidation-v2.yaml new file mode 100644 index 0000000..e6335b7 --- /dev/null +++ b/openapi/paths/wallets/get-wallet-consolidation-v2.yaml @@ -0,0 +1,36 @@ +get: + tags: + - Wallets API + summary: Get details of merchant wallet consolidation V2 + description: + 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. + operationId: getWalletConsolidationV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: addressIds + in: query + required: false + schema: + type: string + description: comma-separated values of addresses for which merchant wants to check details before executing sweep + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../../components/responses/wallets/consolidationRes.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + + diff --git a/openapi/paths/wallets/get-wallet-transaction-v1.yaml b/openapi/paths/wallets/get-wallet-transaction-v1.yaml new file mode 100644 index 0000000..f434091 --- /dev/null +++ b/openapi/paths/wallets/get-wallet-transaction-v1.yaml @@ -0,0 +1,40 @@ +get: + tags: + - Wallets API + summary: Get wallet transaction V1 + description: | + 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. + operationId: getTransactionByWalletIdV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: transactionId + in: query + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the transaction Id + - name: spendRequestId + in: query + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the spend request Id + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/WalletTransactionObj-v1.yaml + '404': + description: Wallet not found + diff --git a/openapi/paths/wallets/get-wallet-transaction-v2.yaml b/openapi/paths/wallets/get-wallet-transaction-v2.yaml new file mode 100644 index 0000000..f2a0b00 --- /dev/null +++ b/openapi/paths/wallets/get-wallet-transaction-v2.yaml @@ -0,0 +1,40 @@ +get: + tags: + - Wallets API + summary: Get wallet transaction V2 + description: | + 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. + operationId: getTransactionByWalletIdV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: transactionId + in: query + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the transaction Id + - name: spendRequestId + in: query + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the spend request Id + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/WalletTransactionObj-v2.yaml + '404': + description: Wallet not found + diff --git a/openapi/paths/wallets/get-wallet-transactions-v1.yaml b/openapi/paths/wallets/get-wallet-transactions-v1.yaml new file mode 100644 index 0000000..aa5fa96 --- /dev/null +++ b/openapi/paths/wallets/get-wallet-transactions-v1.yaml @@ -0,0 +1,26 @@ +get: + tags: + - Wallets API + summary: Get wallet transactions V1 + description: Retrieves a list of all wallet transactions + operationId: getTransactionsByWalletIdV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/arrayOfWalletTransactions-v1.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + diff --git a/openapi/paths/wallets/get-wallet-transactions-v2.yaml b/openapi/paths/wallets/get-wallet-transactions-v2.yaml new file mode 100644 index 0000000..2c666ab --- /dev/null +++ b/openapi/paths/wallets/get-wallet-transactions-v2.yaml @@ -0,0 +1,26 @@ +get: + tags: + - Wallets API + summary: Get wallet transactions V2 + description: Retrieves a list of all wallet transactions + operationId: getTransactionsByWalletIdV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/arrayOfWalletTransactions-v2.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + diff --git a/openapi/paths/wallets/spend-request-confirmation-v1.yaml b/openapi/paths/wallets/spend-request-confirmation-v1.yaml new file mode 100644 index 0000000..80a5dfa --- /dev/null +++ b/openapi/paths/wallets/spend-request-confirmation-v1.yaml @@ -0,0 +1,34 @@ +post: + tags: + - Wallets API + summary: Confirm spend or convert request V1 + description: Send a request to confirm the withdrawal or conversion + operationId: spendRequestConfirmationV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id from which you intend to withdraw funds + requestBody: + content: + application/json: + schema: + type: object + required: + - spendRequestId + properties: + spendRequestId: + type: string + description: id of the spend request for withdrawal or conversion + + responses: + '200': + description: Success + '404': + description: Spend request not found or expired + $ref: ../../components/responses/Problem.yaml + + diff --git a/openapi/paths/wallets/spend-request-confirmation-v2.yaml b/openapi/paths/wallets/spend-request-confirmation-v2.yaml new file mode 100644 index 0000000..36df399 --- /dev/null +++ b/openapi/paths/wallets/spend-request-confirmation-v2.yaml @@ -0,0 +1,34 @@ +post: + tags: + - Wallets API + summary: Confirm spend or convert request V2 + description: Send a request to confirm the withdrawal or conversion + operationId: spendRequestConfirmationV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id from which you intend to withdraw funds + requestBody: + content: + application/json: + schema: + type: object + required: + - spendRequestId + properties: + spendRequestId: + type: string + description: id of the spend request for withdrawal or conversion + + responses: + '200': + description: Success + '404': + description: Spend request not found or expired + $ref: ../../components/responses/Problem.yaml + + diff --git a/openapi/paths/wallets/spend-request-v1.yaml b/openapi/paths/wallets/spend-request-v1.yaml new file mode 100644 index 0000000..00d2800 --- /dev/null +++ b/openapi/paths/wallets/spend-request-v1.yaml @@ -0,0 +1,34 @@ +post: + tags: + - Wallets API + summary: Create spend or convert request V1 + description: + $ref: './create-withdrawal-description.md' + operationId: sendSpendRequestV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id where you intend to withdraw funds from + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/SpendRequestPayload-v1.yaml + description: Withdrawal Request payload + required: true + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/responses/wallets/SpendRequestConfirmationSuccess-v1.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + diff --git a/openapi/paths/wallets/spend-request-v2.yaml b/openapi/paths/wallets/spend-request-v2.yaml new file mode 100644 index 0000000..1b2e37e --- /dev/null +++ b/openapi/paths/wallets/spend-request-v2.yaml @@ -0,0 +1,34 @@ +post: + tags: + - Wallets API + summary: Create spend or convert request V2 + description: + $ref: './create-withdrawal-description.md' + operationId: sendSpendRequestV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id where you intend to withdraw funds from + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/wallets/SpendRequestPayload-v2.yaml + description: Withdrawal Request payload + required: true + responses: + '200': + description: Ok + content: + application/json: + schema: + $ref: ../../components/responses/wallets/SpendRequestConfirmationSuccess-v2.yaml + '401': + description: Unauthorized + '403': + description: Forbidden + diff --git a/openapi/paths/wallets/update-address-webhook-url-v1.yaml b/openapi/paths/wallets/update-address-webhook-url-v1.yaml new file mode 100644 index 0000000..b2f4f0d --- /dev/null +++ b/openapi/paths/wallets/update-address-webhook-url-v1.yaml @@ -0,0 +1,40 @@ +put: + tags: + - Wallets API + summary: Update address webhook Url V1 + description: | + Allows to update Url used to receiving webhooks for address transactions + operationId: updateAddressWebhookUrlV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: addressIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the address Id + requestBody: + content: + application/json: + schema: + type: object + properties: + notificationUrl: + type: string + description: merchant's Url where webhooks are sent + description: Update address webhook Url + required: true + responses: + '200': + description: Success + '401': + description: Unauthorized + '403': + description: Forbidden \ No newline at end of file diff --git a/openapi/paths/wallets/update-address-webhook-url-v2.yaml b/openapi/paths/wallets/update-address-webhook-url-v2.yaml new file mode 100644 index 0000000..74fe1d5 --- /dev/null +++ b/openapi/paths/wallets/update-address-webhook-url-v2.yaml @@ -0,0 +1,40 @@ +put: + tags: + - Wallets API + summary: Update address webhook Url V2 + description: | + Allows to update Url used to receiving webhooks for address transactions + operationId: updateAddressWebhookUrlV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + - name: addressIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the address Id + requestBody: + content: + application/json: + schema: + type: object + properties: + notificationUrl: + type: string + description: merchant's Url where webhooks are sent + description: Update address webhook Url + required: true + responses: + '200': + description: Success + '401': + description: Unauthorized + '403': + description: Forbidden \ No newline at end of file diff --git a/openapi/paths/wallets/update-wallet-webhook-url-v1.yaml b/openapi/paths/wallets/update-wallet-webhook-url-v1.yaml new file mode 100644 index 0000000..3ec9355 --- /dev/null +++ b/openapi/paths/wallets/update-wallet-webhook-url-v1.yaml @@ -0,0 +1,33 @@ +put: + tags: + - Wallets API + summary: Update wallet webhook Url V1 + description: | + Allows to update Url used to receiving webhooks for wallet transactions + operationId: updateWalletWebhookUrlV1 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + requestBody: + content: + application/json: + schema: + type: object + properties: + notificationUrl: + type: string + description: merchant's Url where webhooks are sent + description: Update wallet webhook Url + required: true + responses: + '200': + description: Success + '401': + description: Unauthorized + '403': + description: Forbidden \ No newline at end of file diff --git a/openapi/paths/wallets/update-wallet-webhook-url-v2.yaml b/openapi/paths/wallets/update-wallet-webhook-url-v2.yaml new file mode 100644 index 0000000..ce9e5e7 --- /dev/null +++ b/openapi/paths/wallets/update-wallet-webhook-url-v2.yaml @@ -0,0 +1,33 @@ +put: + tags: + - Wallets API + summary: Update wallet webhook Url V2 + description: | + Allows to update Url used to receiving webhooks for wallet transactions + operationId: updateWalletWebhookUrlV2 + parameters: + - name: walletIdStr + in: path + required: true + schema: + type: string + example: '0a54b29f-51cb-44a8-9bed-111c5cb1b335' + description: the wallet Id + requestBody: + content: + application/json: + schema: + type: object + properties: + notificationUrl: + type: string + description: merchant's Url where webhooks are sent + description: Update wallet webhook Url + required: true + responses: + '200': + description: Success + '401': + description: Unauthorized + '403': + description: Forbidden \ No newline at end of file diff --git a/openapi/paths/wallets/wallet-webhook-payload-v1.yaml b/openapi/paths/wallets/wallet-webhook-payload-v1.yaml new file mode 100644 index 0000000..06f4777 --- /dev/null +++ b/openapi/paths/wallets/wallet-webhook-payload-v1.yaml @@ -0,0 +1,17 @@ +post: + tags: + - Wallets API + summary: Webhook Payload V1 + description: | + 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. + operationId: walletNotificationPayloadV1 + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/responses/wallets/wallet-webhook-payload.yaml + '400': + description: CoinPayments API could not reach your server \ No newline at end of file diff --git a/openapi/paths/wallets/wallet-webhook-payload-v2.yaml b/openapi/paths/wallets/wallet-webhook-payload-v2.yaml new file mode 100644 index 0000000..af2bdf6 --- /dev/null +++ b/openapi/paths/wallets/wallet-webhook-payload-v2.yaml @@ -0,0 +1,17 @@ +post: + tags: + - Wallets API + summary: Webhook Payload V2 + description: | + 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. + operationId: walletNotificationPayloadV2 + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/responses/wallets/wallet-webhook-payload.yaml + '400': + description: CoinPayments API could not reach your server \ No newline at end of file diff --git a/openapi/paths/wallets/wallets-description-v1.md b/openapi/paths/wallets/wallets-description-v1.md new file mode 100644 index 0000000..4f83105 --- /dev/null +++ b/openapi/paths/wallets/wallets-description-v1.md @@ -0,0 +1,152 @@ +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. + +--- + +## Permanent vs. Temporary Addresses + +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 runs 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 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 some 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 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. + +--- + +## Simplify Wallet Top-up + +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 customer by incorporating +deposit details like deposit amount, currency and deposit 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](Invoices-API#section/Payment-Flow-for-Integrated-Checkout-with-White-Labeling)** +in the Invoices API. + +--- + +## Webhook Notifications + +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](#operation/createMerchantWalletV1) +or [update](#operation/updateWalletWebhookUrlV1). + +**Note:** If a webhook is missed, you can still check the status of the transaction by polling [getTransactionById endpoint](/#operation/getTransactionByWalletIdV1). + +**IMPORTANT:** Webhooks are a comfortable way to trigger customer balance credit. However, sometimes webhooks may not reach +your server immediately, but you can already see a transaction from your customer on chain. If you decide to credit funds +to the customer account ahead of receiving the webhook, make sure you do not double credit the funds once +the trigger webhook eventually reaches your server. + +### Authenticate Webhooks from CoinPayments to Your Server + +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](#section/Generate-API-Signature) +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. + +### Webhook Types + +The list of wallet/address transactions that support webhook notifications includes: +- **InternalReceive** - receiving funds within the system; +- **UtxoExternalReceive** - receiving funds from external UTXO transfers; +- **AccountBasedExternalReceive** - receiving funds from external account-based transfers; +- **InternalSpend** - sending funds to the address that belongs to CoinPayments; +- **ExternalSpend** - sending funds to the address that does not belong to CoinPayments; +- **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. + +Below is an example of the webhook notification thrown when an external withdrawal is made from a wallet: + +```javascript +{ + "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. + +--- + diff --git a/openapi/paths/wallets/wallets-description-v2.md b/openapi/paths/wallets/wallets-description-v2.md new file mode 100644 index 0000000..e290702 --- /dev/null +++ b/openapi/paths/wallets/wallets-description-v2.md @@ -0,0 +1,153 @@ +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. + +--- + +## Permanent vs. Temporary Addresses + +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 runs 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 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 some 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 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. + +--- + +## Simplify Wallet Top-up + +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 customer by incorporating +deposit details like deposit amount, currency and deposit 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](#section/Payment-Flow-for-Integrated-Checkout-with-White-Labeling)** +in the Invoices API. + +--- + +## Webhook Notifications + +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](#operation/createMerchantWalletV2) +or [update](#operation/updateWalletWebhookUrlV2). + +**Note:** If a webhook is missed, you can still check the status of the transaction by polling [getTransactionById endpoint](/#operation/getTransactionByWalletIdV2). + +**IMPORTANT:** Webhooks are a comfortable way to trigger customer balance credit. However, sometimes webhooks may not reach +your server immediately, but you can already see a transaction from your customer on chain. If you decide to credit funds +to the customer account ahead of receiving the webhook, make sure you do not double credit the funds once +the trigger webhook eventually reaches your server. + +### Authenticate Webhooks from CoinPayments to Your Server + +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](#section/Generate-API-Signature) +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. + +### Webhook Types + +The list of wallet/address transactions that support webhook notifications includes: +- **InternalReceive** - receiving funds within the system; +- **UtxoExternalReceive** - receiving funds from external UTXO transfers; +- **AccountBasedExternalReceive** - receiving funds from external account-based transfers; +- **InternalSpend** - sending funds to the address that belongs to CoinPayments; +- **ExternalSpend** - sending funds to the address that does not belong to CoinPayments; +- **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. + +Below is an example of the webhook notification thrown when an external withdrawal is made from a wallet: + +```javascript +{ + "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. + +--- + diff --git a/openapi/paths/webhooks/update-delete.yaml b/openapi/paths/webhooks/update-delete.yaml new file mode 100644 index 0000000..a783746 --- /dev/null +++ b/openapi/paths/webhooks/update-delete.yaml @@ -0,0 +1,56 @@ +put: + tags: + - Invoice Webhooks API + summary: Update Webhook + description: | + Update list of webhook notifications and/or webhook integration Url + operationId: updateWebhook + parameters: + - name: clientId + in: path + required: true + description: client Id + schema: + $ref: ../../components/globalTypes/id.yaml + - name: webhookId + in: path + required: true + schema: + type: string + description: webhook integration Id + example: 'wLKBuD6h3Vama4mGDqHeF' + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/webhooks/webhookSchema.yaml + responses: + '200': + description: Success + '404': + description: Webhook not found +delete: + tags: + - Invoice Webhooks API + summary: Delete Webhook + description: | + Delete a webhook integration by client Id and webhook Id + operationId: deleteWebhook + parameters: + - name: clientId + in: path + required: true + description: client Id + schema: + $ref: ../../components/globalTypes/id.yaml + - name: webhookId + in: path + required: true + description: webhook Id + schema: + $ref: ../../components/globalTypes/id.yaml + responses: + '204': + description: Success status code - no content + '404': + description: Webhook not found diff --git a/openapi/paths/webhooks/webhook-payload.yaml b/openapi/paths/webhooks/webhook-payload.yaml new file mode 100644 index 0000000..931af2a --- /dev/null +++ b/openapi/paths/webhooks/webhook-payload.yaml @@ -0,0 +1,17 @@ +post: + tags: + - Invoice Webhooks API + summary: Webhook Payload + description: | + 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. + operationId: webhookPayload + responses: + '200': + description: Success status code ( 200 ) + content: + application/json: + schema: + $ref: ../../components/responses/Webhooks/webhook-payload.yaml + '400': + description: CoinPayments API could not reach your server \ No newline at end of file diff --git a/openapi/paths/webhooks/webhook.yaml b/openapi/paths/webhooks/webhook.yaml new file mode 100644 index 0000000..4fff7cf --- /dev/null +++ b/openapi/paths/webhooks/webhook.yaml @@ -0,0 +1,60 @@ +post: + tags: + - Invoice Webhooks API + summary: Create client webhook + description: | + Creates new client webhook + operationId: createWebhook + parameters: + - name: clientId + in: path + required: true + description: client Id + schema: + $ref: ../../components/globalTypes/id.yaml + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas/webhooks/webhookSchema.yaml + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: ../../components/responses/clients/createWebhook.yaml + '404': + description: Merchant Not Found! +get: + tags: + - Invoice Webhooks API + summary: Get webhooks of merchant + description: | + Get list of merchant webhook notifications + operationId: getMerchantWebhooks + parameters: + - name: clientId + in: path + required: true + description: client Id + schema: + $ref: ../../components/globalTypes/id.yaml + - name: type + in: query + required: false + description: Optional parameter; if specified, only webhooks that support this notification type are returned. Available values are invoiceCreated, invoicePending, invoicePaid, invoiceCompleted, invoiceCancelled, invoiceTimedOut + schema: + type: string + description: type of the webhook notification. Available values are invoiceCreated, invoicePending, invoicePaid, invoiceCompleted, invoiceCancelled, invoiceTimedOut + responses: + '200': + description: Success - List of merchant webhook notifications + content: + application/json: + schema: + $ref: ../../components/responses/clients/list-webhooks.yaml + '404': + description: Merchant Not Found! + + diff --git a/openapi/paths/webhooks/webhooks.md b/openapi/paths/webhooks/webhooks.md new file mode 100644 index 0000000..7511694 --- /dev/null +++ b/openapi/paths/webhooks/webhooks.md @@ -0,0 +1,204 @@ +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` + +**IMPORTANT:** Webhooks are a comfortable way to trigger customer balance credit. However, sometimes webhooks may not reach +your server immediately, but you can already see a transaction from your customer on chain. If you decide to credit funds +to the customer account ahead of receiving the webhook, make sure you do not double credit the funds once +the trigger webhook eventually reaches your server. + +## Webhook Types and Statuses + +Currently, CoinPayments supports webhook notifications for the following transaction types: +- **invoices** +- **withdrawals** (sent transactions) +- **deposits** (received transactions). + +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](/#tag/Wallets-API)**. + +Here is a list of invoice events for which merchants can choose to receive notifications: + +- **invoiceCreated:** triggered when a new invoice is created. Invoice state transmitted - "unpaid" +- **invoicePending:** triggered when the transfer amount is detected on the blockchain and the transaction has received + enough confirmations on chain. Invoice state transmitted - "pending" +- **invoicePaid:** triggered when an invoice is successfully paid. A paid invoice means the funds are received in the + CoinPayments' wallet for further payout to the merchant. Invoice state transmitted - "paid" +- **invoiceCompleted:** triggered when the invoice is paid **and** funds are added to merchant's balance. Invoice state transmitted - "completed" +- **invoiceCancelled:** triggered when an invoice is cancelled by the merchant. Invoice state transmitted - "cancelled" +- **invoiceTimedOut:** triggered once invoice expiration date and time is over. Invoice state transmitted - "tinedOut" + +To see the webhook payload definition, see **[Webhook Payload](#operation/webhookPayload)**. + +--- + +## Invoices Webhooks Setup + +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](/#section/Create-Credentials). Then +follow these steps: +- Access the dashboard and click on "Integrations" in the left sidebar. +- Click on the integration that you want to use for webhooks. +- On the left side of the popup screen, in the "Permissions" field select all necessary actions for which you would like to enable your API integration. +For invoices select "Create Invoice", "List Invoices", "Find Invoice", "Invoice Payouts", "List Invoice History". +- Click "Save" to confirm your selections. + +To create a webhook through the UI, continue in the popup screen with the following steps: +- On the right side of the popup screen, open the dropdown menu to specify the events for which you want to receive notifications. +- Click "Save" to confirm your selections. + +To set up webhook notifications through the API calls, follow these steps: +- Create a webhook using ['createWebhook' endpoint](/#operation/createWebhook) 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. + +**Note:** If a webhook is missed, you can still check the status of the invoice by polling [getPaymentStatus endpoint](/#operation/getPaymentStatus) +or [getInvoiceById endpoint](/#operation/getInvoiceByIdV2). + +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. + +![markdown file changed](./webhooks-flowchart.png) + +--- + +## Authenticate Webhooks from CoinPayments to Your Server + +All webhook messages from CoinPayments contain the same headers as used by merchants to [sign requests](#section/Generate-API-Signature) +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. \ No newline at end of file diff --git a/openapi/reference.page.yaml b/openapi/reference.page.yaml new file mode 100644 index 0000000..451207b --- /dev/null +++ b/openapi/reference.page.yaml @@ -0,0 +1,8 @@ +type: reference-docs +definitionId: petstore +settings: + generateCodeSamples: + languages: + - lang: curl + - lang: JavaScript + - lang: Node.js diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6a8c1f9 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1599 @@ +{ + "name": "coinpayments-api", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "coinpayments-api", + "version": "1.0.0", + "dependencies": { + "@redocly/cli": "1.0.0-beta.108" + } + }, + "node_modules/@redocly/ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-9GWx27t7xWhDIR02PA18nzBdLcKQRgc46xNQvjFkrYk4UOmvKhJ/dawwiX0cCOeetN5LcaaiqQbVOWYK62SGHw==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@redocly/cli": { + "version": "1.0.0-beta.108", + "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.0.0-beta.108.tgz", + "integrity": "sha512-ZPwPi4AKGTmvjrLPbGSlrPLKOfwvvj4tiBZMDBsyCehglU7Fhj6bw+cr3TrDhiD/JKqlpqXohUx2Sker4aLx5g==", + "dependencies": { + "@redocly/openapi-core": "1.0.0-beta.108", + "assert-node-version": "^1.0.3", + "chokidar": "^3.5.1", + "colorette": "^1.2.0", + "glob": "^7.1.6", + "glob-promise": "^3.4.0", + "handlebars": "^4.7.6", + "portfinder": "^1.0.26", + "simple-websocket": "^9.0.0", + "yargs": "17.0.1" + }, + "bin": { + "openapi": "bin/cli.js", + "redocly": "bin/cli.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@redocly/openapi-core": { + "version": "1.0.0-beta.108", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.0.0-beta.108.tgz", + "integrity": "sha512-4Lq7KB+XiBvVzpaY/M0a8qog/Zr8kGrvJbRW2z7Sk2Zpc/m+8LTuZbRh15eMoneVc13M9qbHFIRh3PG18g3Tng==", + "dependencies": { + "@redocly/ajv": "^8.6.5", + "@types/node": "^14.11.8", + "colorette": "^1.2.0", + "js-levenshtein": "^1.1.6", + "js-yaml": "^4.1.0", + "lodash.isequal": "^4.5.0", + "minimatch": "^5.0.1", + "node-fetch": "^2.6.1", + "pluralize": "^8.0.0", + "yaml-ast-parser": "0.0.43" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@types/glob": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.0.0.tgz", + "integrity": "sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==", + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" + }, + "node_modules/@types/node": { + "version": "14.18.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.33.tgz", + "integrity": "sha512-qelS/Ra6sacc4loe/3MSjXNL1dNQ/GjxNHVzuChwMfmk7HuycRLVQN2qNY3XahK+fZc5E2szqQSKUyAF0E+2bg==" + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/assert-node-version": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/assert-node-version/-/assert-node-version-1.0.3.tgz", + "integrity": "sha512-XcKBGJ1t0RrCcus9dQX57FER4PTEz/+Tee2jj+EdFIGyw5j8hwDNXZzgRYLQ916twVjSuA47adrZsSxLbpEX9A==", + "dependencies": { + "expected-node-version": "^1.0.0", + "semver": "^5.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/expected-node-version": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/expected-node-version/-/expected-node-version-1.0.2.tgz", + "integrity": "sha512-OSaCdgF02srujDqJz1JWGpqk8Rq3uNYHLmtpBHJrZN3BvuMvzijJMqRVxZN1qLJtKVwjXhmOp+lfsRUqx8n54w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-promise": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz", + "integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==", + "dependencies": { + "@types/glob": "*" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "glob": "*" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, + "node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/portfinder": { + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz", + "integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==", + "dependencies": { + "async": "^2.6.4", + "debug": "^3.2.7", + "mkdirp": "^0.5.6" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/simple-websocket": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/simple-websocket/-/simple-websocket-9.1.0.tgz", + "integrity": "sha512-8MJPnjRN6A8UCp1I+H/dSFyjwJhp6wta4hsVRhjf8w9qBHRzxYt14RaOcjvQnhD1N4yKOddEjflwMnQM4VtXjQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "debug": "^4.3.1", + "queue-microtask": "^1.2.2", + "randombytes": "^2.1.0", + "readable-stream": "^3.6.0", + "ws": "^7.4.2" + } + }, + "node_modules/simple-websocket/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/simple-websocket/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yaml-ast-parser": { + "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==" + }, + "node_modules/yargs": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.1.tgz", + "integrity": "sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } + } + }, + "dependencies": { + "@redocly/ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-9GWx27t7xWhDIR02PA18nzBdLcKQRgc46xNQvjFkrYk4UOmvKhJ/dawwiX0cCOeetN5LcaaiqQbVOWYK62SGHw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "@redocly/cli": { + "version": "1.0.0-beta.108", + "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.0.0-beta.108.tgz", + "integrity": "sha512-ZPwPi4AKGTmvjrLPbGSlrPLKOfwvvj4tiBZMDBsyCehglU7Fhj6bw+cr3TrDhiD/JKqlpqXohUx2Sker4aLx5g==", + "requires": { + "@redocly/openapi-core": "1.0.0-beta.108", + "assert-node-version": "^1.0.3", + "chokidar": "^3.5.1", + "colorette": "^1.2.0", + "glob": "^7.1.6", + "glob-promise": "^3.4.0", + "handlebars": "^4.7.6", + "portfinder": "^1.0.26", + "simple-websocket": "^9.0.0", + "yargs": "17.0.1" + } + }, + "@redocly/openapi-core": { + "version": "1.0.0-beta.108", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.0.0-beta.108.tgz", + "integrity": "sha512-4Lq7KB+XiBvVzpaY/M0a8qog/Zr8kGrvJbRW2z7Sk2Zpc/m+8LTuZbRh15eMoneVc13M9qbHFIRh3PG18g3Tng==", + "requires": { + "@redocly/ajv": "^8.6.5", + "@types/node": "^14.11.8", + "colorette": "^1.2.0", + "js-levenshtein": "^1.1.6", + "js-yaml": "^4.1.0", + "lodash.isequal": "^4.5.0", + "minimatch": "^5.0.1", + "node-fetch": "^2.6.1", + "pluralize": "^8.0.0", + "yaml-ast-parser": "0.0.43" + } + }, + "@types/glob": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.0.0.tgz", + "integrity": "sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==", + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" + }, + "@types/node": { + "version": "14.18.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.33.tgz", + "integrity": "sha512-qelS/Ra6sacc4loe/3MSjXNL1dNQ/GjxNHVzuChwMfmk7HuycRLVQN2qNY3XahK+fZc5E2szqQSKUyAF0E+2bg==" + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "assert-node-version": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/assert-node-version/-/assert-node-version-1.0.3.tgz", + "integrity": "sha512-XcKBGJ1t0RrCcus9dQX57FER4PTEz/+Tee2jj+EdFIGyw5j8hwDNXZzgRYLQ916twVjSuA47adrZsSxLbpEX9A==", + "requires": { + "expected-node-version": "^1.0.0", + "semver": "^5.0.3" + } + }, + "async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "requires": { + "lodash": "^4.17.14" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "expected-node-version": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/expected-node-version/-/expected-node-version-1.0.2.tgz", + "integrity": "sha512-OSaCdgF02srujDqJz1JWGpqk8Rq3uNYHLmtpBHJrZN3BvuMvzijJMqRVxZN1qLJtKVwjXhmOp+lfsRUqx8n54w==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-promise": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz", + "integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==", + "requires": { + "@types/glob": "*" + } + }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==" + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==" + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "requires": { + "minimist": "^1.2.6" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==" + }, + "portfinder": { + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz", + "integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==", + "requires": { + "async": "^2.6.4", + "debug": "^3.2.7", + "mkdirp": "^0.5.6" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "requires": { + "picomatch": "^2.2.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "simple-websocket": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/simple-websocket/-/simple-websocket-9.1.0.tgz", + "integrity": "sha512-8MJPnjRN6A8UCp1I+H/dSFyjwJhp6wta4hsVRhjf8w9qBHRzxYt14RaOcjvQnhD1N4yKOddEjflwMnQM4VtXjQ==", + "requires": { + "debug": "^4.3.1", + "queue-microtask": "^1.2.2", + "randombytes": "^2.1.0", + "readable-stream": "^3.6.0", + "ws": "^7.4.2" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "optional": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "requires": {} + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yaml-ast-parser": { + "version": "0.0.43", + "resolved": "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz", + "integrity": "sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==" + }, + "yargs": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.1.tgz", + "integrity": "sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b7ec37d --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "coinpayments-api", + "version": "1.0.0", + "dependencies": { + "@redocly/cli": "1.0.0-beta.108" + }, + "private": true, + "scripts": { + "start": "redocly preview-docs", + "build": "redocly bundle -o dist", + "test": "redocly lint" + } +} diff --git a/tutorial-styles.css b/tutorial-styles.css deleted file mode 100644 index 1cd5156..0000000 --- a/tutorial-styles.css +++ /dev/null @@ -1 +0,0 @@ -html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}[class*=grid-],[class*=grid_],[class~=grid]{box-sizing:border-box;display:flex;flex-flow:row wrap;margin:0 -.5rem}[class*=col-],[class*=col_],[class~=col]{box-sizing:border-box;padding:0 .5rem 1rem;max-width:100%}[class*=col_],[class~=col]{flex:1 1 0%}[class*=col-]{flex:none}[class*=grid-][class*=col-],[class*=grid-][class*=col_],[class*=grid-][class~=col],[class*=grid_][class*=col-],[class*=grid_][class*=col_],[class*=grid_][class~=col],[class~=grid][class*=col-],[class~=grid][class*=col_],[class~=grid][class~=col]{margin:0;padding:0}[class*=grid-][class*=-noGutter]{margin:0}[class*=grid-][class*=-noGutter]>[class*=col-],[class*=grid-][class*=-noGutter]>[class~=col]{padding:0}[class*=grid-][class*=-noWrap]{flex-wrap:nowrap}[class*=grid-][class*=-center]{justify-content:center}[class*=grid-][class*=-right]{justify-content:flex-end;align-self:flex-end;margin-left:auto}[class*=grid-][class*=-top]{align-items:flex-start}[class*=grid-][class*=-middle]{align-items:center}[class*=grid-][class*=-bottom]{align-items:flex-end}[class*=grid-][class*=-reverse]{flex-direction:row-reverse}[class*=grid-][class*=-column]{flex-direction:column}[class*=grid-][class*=-column]>[class*=col-]{flex-basis:auto}[class*=grid-][class*=-column-reverse]{flex-direction:column-reverse}[class*=grid-][class*=-spaceBetween]{justify-content:space-between}[class*=grid-][class*=-spaceAround]{justify-content:space-around}[class*=grid-][class*=-equalHeight]>[class*=col-],[class*=grid-][class*=-equalHeight]>[class*=col_],[class*=grid-][class*=-equalHeight]>[class~=col]{align-self:stretch}[class*=grid-][class*=-equalHeight]>[class*=col-]>*,[class*=grid-][class*=-equalHeight]>[class*=col_]>*,[class*=grid-][class*=-equalHeight]>[class~=col]>*{height:100%}[class*=grid-][class*=-noBottom]>[class*=col-],[class*=grid-][class*=-noBottom]>[class*=col_],[class*=grid-][class*=-noBottom]>[class~=col]{padding-bottom:0}[class*=col-][class*=-top]{align-self:flex-start}[class*=col-][class*=-middle]{align-self:center}[class*=col-][class*=-bottom]{align-self:flex-end}[class*=col-][class*=-first]{order:-1}[class*=col-][class*=-last]{order:1}[class*=grid-1]>[class*=col-],[class*=grid-1]>[class*=col_],[class*=grid-1]>[class~=col]{flex-basis:100%;max-width:100%}[class*=grid-2]>[class*=col-],[class*=grid-2]>[class*=col_],[class*=grid-2]>[class~=col]{flex-basis:50%;max-width:50%}[class*=grid-3]>[class*=col-],[class*=grid-3]>[class*=col_],[class*=grid-3]>[class~=col]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=grid-4]>[class*=col-],[class*=grid-4]>[class*=col_],[class*=grid-4]>[class~=col]{flex-basis:25%;max-width:25%}[class*=grid-5]>[class*=col-],[class*=grid-5]>[class*=col_],[class*=grid-5]>[class~=col]{flex-basis:20%;max-width:20%}[class*=grid-6]>[class*=col-],[class*=grid-6]>[class*=col_],[class*=grid-6]>[class~=col]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=grid-7]>[class*=col-],[class*=grid-7]>[class*=col_],[class*=grid-7]>[class~=col]{flex-basis:14.2857142857%;max-width:14.2857142857%}[class*=grid-8]>[class*=col-],[class*=grid-8]>[class*=col_],[class*=grid-8]>[class~=col]{flex-basis:12.5%;max-width:12.5%}[class*=grid-9]>[class*=col-],[class*=grid-9]>[class*=col_],[class*=grid-9]>[class~=col]{flex-basis:11.1111111111%;max-width:11.1111111111%}[class*=grid-10]>[class*=col-],[class*=grid-10]>[class*=col_],[class*=grid-10]>[class~=col]{flex-basis:10%;max-width:10%}[class*=grid-11]>[class*=col-],[class*=grid-11]>[class*=col_],[class*=grid-11]>[class~=col]{flex-basis:9.0909090909%;max-width:9.0909090909%}[class*=grid-12]>[class*=col-],[class*=grid-12]>[class*=col_],[class*=grid-12]>[class~=col]{flex-basis:8.3333333333%;max-width:8.3333333333%}@media (max-width:80em){[class*=_lg-1]>[class*=col-],[class*=_lg-1]>[class*=col_],[class*=_lg-1]>[class~=col]{flex-basis:100%;max-width:100%}[class*=_lg-2]>[class*=col-],[class*=_lg-2]>[class*=col_],[class*=_lg-2]>[class~=col]{flex-basis:50%;max-width:50%}[class*=_lg-3]>[class*=col-],[class*=_lg-3]>[class*=col_],[class*=_lg-3]>[class~=col]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=_lg-4]>[class*=col-],[class*=_lg-4]>[class*=col_],[class*=_lg-4]>[class~=col]{flex-basis:25%;max-width:25%}[class*=_lg-5]>[class*=col-],[class*=_lg-5]>[class*=col_],[class*=_lg-5]>[class~=col]{flex-basis:20%;max-width:20%}[class*=_lg-6]>[class*=col-],[class*=_lg-6]>[class*=col_],[class*=_lg-6]>[class~=col]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=_lg-7]>[class*=col-],[class*=_lg-7]>[class*=col_],[class*=_lg-7]>[class~=col]{flex-basis:14.2857142857%;max-width:14.2857142857%}[class*=_lg-8]>[class*=col-],[class*=_lg-8]>[class*=col_],[class*=_lg-8]>[class~=col]{flex-basis:12.5%;max-width:12.5%}[class*=_lg-9]>[class*=col-],[class*=_lg-9]>[class*=col_],[class*=_lg-9]>[class~=col]{flex-basis:11.1111111111%;max-width:11.1111111111%}[class*=_lg-10]>[class*=col-],[class*=_lg-10]>[class*=col_],[class*=_lg-10]>[class~=col]{flex-basis:10%;max-width:10%}[class*=_lg-11]>[class*=col-],[class*=_lg-11]>[class*=col_],[class*=_lg-11]>[class~=col]{flex-basis:9.0909090909%;max-width:9.0909090909%}[class*=_lg-12]>[class*=col-],[class*=_lg-12]>[class*=col_],[class*=_lg-12]>[class~=col]{flex-basis:8.3333333333%;max-width:8.3333333333%}}@media (max-width:64em){[class*=_md-1]>[class*=col-],[class*=_md-1]>[class*=col_],[class*=_md-1]>[class~=col]{flex-basis:100%;max-width:100%}[class*=_md-2]>[class*=col-],[class*=_md-2]>[class*=col_],[class*=_md-2]>[class~=col]{flex-basis:50%;max-width:50%}[class*=_md-3]>[class*=col-],[class*=_md-3]>[class*=col_],[class*=_md-3]>[class~=col]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=_md-4]>[class*=col-],[class*=_md-4]>[class*=col_],[class*=_md-4]>[class~=col]{flex-basis:25%;max-width:25%}[class*=_md-5]>[class*=col-],[class*=_md-5]>[class*=col_],[class*=_md-5]>[class~=col]{flex-basis:20%;max-width:20%}[class*=_md-6]>[class*=col-],[class*=_md-6]>[class*=col_],[class*=_md-6]>[class~=col]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=_md-7]>[class*=col-],[class*=_md-7]>[class*=col_],[class*=_md-7]>[class~=col]{flex-basis:14.2857142857%;max-width:14.2857142857%}[class*=_md-8]>[class*=col-],[class*=_md-8]>[class*=col_],[class*=_md-8]>[class~=col]{flex-basis:12.5%;max-width:12.5%}[class*=_md-9]>[class*=col-],[class*=_md-9]>[class*=col_],[class*=_md-9]>[class~=col]{flex-basis:11.1111111111%;max-width:11.1111111111%}[class*=_md-10]>[class*=col-],[class*=_md-10]>[class*=col_],[class*=_md-10]>[class~=col]{flex-basis:10%;max-width:10%}[class*=_md-11]>[class*=col-],[class*=_md-11]>[class*=col_],[class*=_md-11]>[class~=col]{flex-basis:9.0909090909%;max-width:9.0909090909%}[class*=_md-12]>[class*=col-],[class*=_md-12]>[class*=col_],[class*=_md-12]>[class~=col]{flex-basis:8.3333333333%;max-width:8.3333333333%}}@media (max-width:48em){[class*=_sm-1]>[class*=col-],[class*=_sm-1]>[class*=col_],[class*=_sm-1]>[class~=col]{flex-basis:100%;max-width:100%}[class*=_sm-2]>[class*=col-],[class*=_sm-2]>[class*=col_],[class*=_sm-2]>[class~=col]{flex-basis:50%;max-width:50%}[class*=_sm-3]>[class*=col-],[class*=_sm-3]>[class*=col_],[class*=_sm-3]>[class~=col]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=_sm-4]>[class*=col-],[class*=_sm-4]>[class*=col_],[class*=_sm-4]>[class~=col]{flex-basis:25%;max-width:25%}[class*=_sm-5]>[class*=col-],[class*=_sm-5]>[class*=col_],[class*=_sm-5]>[class~=col]{flex-basis:20%;max-width:20%}[class*=_sm-6]>[class*=col-],[class*=_sm-6]>[class*=col_],[class*=_sm-6]>[class~=col]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=_sm-7]>[class*=col-],[class*=_sm-7]>[class*=col_],[class*=_sm-7]>[class~=col]{flex-basis:14.2857142857%;max-width:14.2857142857%}[class*=_sm-8]>[class*=col-],[class*=_sm-8]>[class*=col_],[class*=_sm-8]>[class~=col]{flex-basis:12.5%;max-width:12.5%}[class*=_sm-9]>[class*=col-],[class*=_sm-9]>[class*=col_],[class*=_sm-9]>[class~=col]{flex-basis:11.1111111111%;max-width:11.1111111111%}[class*=_sm-10]>[class*=col-],[class*=_sm-10]>[class*=col_],[class*=_sm-10]>[class~=col]{flex-basis:10%;max-width:10%}[class*=_sm-11]>[class*=col-],[class*=_sm-11]>[class*=col_],[class*=_sm-11]>[class~=col]{flex-basis:9.0909090909%;max-width:9.0909090909%}[class*=_sm-12]>[class*=col-],[class*=_sm-12]>[class*=col_],[class*=_sm-12]>[class~=col]{flex-basis:8.3333333333%;max-width:8.3333333333%}}@media (max-width:36em){[class*=_xs-1]>[class*=col-],[class*=_xs-1]>[class*=col_],[class*=_xs-1]>[class~=col]{flex-basis:100%;max-width:100%}[class*=_xs-2]>[class*=col-],[class*=_xs-2]>[class*=col_],[class*=_xs-2]>[class~=col]{flex-basis:50%;max-width:50%}[class*=_xs-3]>[class*=col-],[class*=_xs-3]>[class*=col_],[class*=_xs-3]>[class~=col]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=_xs-4]>[class*=col-],[class*=_xs-4]>[class*=col_],[class*=_xs-4]>[class~=col]{flex-basis:25%;max-width:25%}[class*=_xs-5]>[class*=col-],[class*=_xs-5]>[class*=col_],[class*=_xs-5]>[class~=col]{flex-basis:20%;max-width:20%}[class*=_xs-6]>[class*=col-],[class*=_xs-6]>[class*=col_],[class*=_xs-6]>[class~=col]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=_xs-7]>[class*=col-],[class*=_xs-7]>[class*=col_],[class*=_xs-7]>[class~=col]{flex-basis:14.2857142857%;max-width:14.2857142857%}[class*=_xs-8]>[class*=col-],[class*=_xs-8]>[class*=col_],[class*=_xs-8]>[class~=col]{flex-basis:12.5%;max-width:12.5%}[class*=_xs-9]>[class*=col-],[class*=_xs-9]>[class*=col_],[class*=_xs-9]>[class~=col]{flex-basis:11.1111111111%;max-width:11.1111111111%}[class*=_xs-10]>[class*=col-],[class*=_xs-10]>[class*=col_],[class*=_xs-10]>[class~=col]{flex-basis:10%;max-width:10%}[class*=_xs-11]>[class*=col-],[class*=_xs-11]>[class*=col_],[class*=_xs-11]>[class~=col]{flex-basis:9.0909090909%;max-width:9.0909090909%}[class*=_xs-12]>[class*=col-],[class*=_xs-12]>[class*=col_],[class*=_xs-12]>[class~=col]{flex-basis:8.3333333333%;max-width:8.3333333333%}}[class*=grid-]>[class*=col-1],[class*=grid_]>[class*=col-1],[class~=grid]>[class*=col-1]{flex-basis:8.3333333333%;max-width:8.3333333333%}[class*=grid-]>[class*=col-2],[class*=grid_]>[class*=col-2],[class~=grid]>[class*=col-2]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=grid-]>[class*=col-3],[class*=grid_]>[class*=col-3],[class~=grid]>[class*=col-3]{flex-basis:25%;max-width:25%}[class*=grid-]>[class*=col-4],[class*=grid_]>[class*=col-4],[class~=grid]>[class*=col-4]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=grid-]>[class*=col-5],[class*=grid_]>[class*=col-5],[class~=grid]>[class*=col-5]{flex-basis:41.6666666667%;max-width:41.6666666667%}[class*=grid-]>[class*=col-6],[class*=grid_]>[class*=col-6],[class~=grid]>[class*=col-6]{flex-basis:50%;max-width:50%}[class*=grid-]>[class*=col-7],[class*=grid_]>[class*=col-7],[class~=grid]>[class*=col-7]{flex-basis:58.3333333333%;max-width:58.3333333333%}[class*=grid-]>[class*=col-8],[class*=grid_]>[class*=col-8],[class~=grid]>[class*=col-8]{flex-basis:66.6666666667%;max-width:66.6666666667%}[class*=grid-]>[class*=col-9],[class*=grid_]>[class*=col-9],[class~=grid]>[class*=col-9]{flex-basis:75%;max-width:75%}[class*=grid-]>[class*=col-10],[class*=grid_]>[class*=col-10],[class~=grid]>[class*=col-10]{flex-basis:83.3333333333%;max-width:83.3333333333%}[class*=grid-]>[class*=col-11],[class*=grid_]>[class*=col-11],[class~=grid]>[class*=col-11]{flex-basis:91.6666666667%;max-width:91.6666666667%}[class*=grid-]>[class*=col-12],[class*=grid_]>[class*=col-12],[class~=grid]>[class*=col-12]{flex-basis:100%;max-width:100%}[class*=grid-]>[data-push-left*=off-0],[class*=grid_]>[data-push-left*=off-0],[class~=grid]>[data-push-left*=off-0]{margin-left:0}[class*=grid-]>[data-push-left*=off-1],[class*=grid_]>[data-push-left*=off-1],[class~=grid]>[data-push-left*=off-1]{margin-left:8.3333333333%}[class*=grid-]>[data-push-left*=off-2],[class*=grid_]>[data-push-left*=off-2],[class~=grid]>[data-push-left*=off-2]{margin-left:16.6666666667%}[class*=grid-]>[data-push-left*=off-3],[class*=grid_]>[data-push-left*=off-3],[class~=grid]>[data-push-left*=off-3]{margin-left:25%}[class*=grid-]>[data-push-left*=off-4],[class*=grid_]>[data-push-left*=off-4],[class~=grid]>[data-push-left*=off-4]{margin-left:33.3333333333%}[class*=grid-]>[data-push-left*=off-5],[class*=grid_]>[data-push-left*=off-5],[class~=grid]>[data-push-left*=off-5]{margin-left:41.6666666667%}[class*=grid-]>[data-push-left*=off-6],[class*=grid_]>[data-push-left*=off-6],[class~=grid]>[data-push-left*=off-6]{margin-left:50%}[class*=grid-]>[data-push-left*=off-7],[class*=grid_]>[data-push-left*=off-7],[class~=grid]>[data-push-left*=off-7]{margin-left:58.3333333333%}[class*=grid-]>[data-push-left*=off-8],[class*=grid_]>[data-push-left*=off-8],[class~=grid]>[data-push-left*=off-8]{margin-left:66.6666666667%}[class*=grid-]>[data-push-left*=off-9],[class*=grid_]>[data-push-left*=off-9],[class~=grid]>[data-push-left*=off-9]{margin-left:75%}[class*=grid-]>[data-push-left*=off-10],[class*=grid_]>[data-push-left*=off-10],[class~=grid]>[data-push-left*=off-10]{margin-left:83.3333333333%}[class*=grid-]>[data-push-left*=off-11],[class*=grid_]>[data-push-left*=off-11],[class~=grid]>[data-push-left*=off-11]{margin-left:91.6666666667%}[class*=grid-]>[data-push-right*=off-0],[class*=grid_]>[data-push-right*=off-0],[class~=grid]>[data-push-right*=off-0]{margin-right:0}[class*=grid-]>[data-push-right*=off-1],[class*=grid_]>[data-push-right*=off-1],[class~=grid]>[data-push-right*=off-1]{margin-right:8.3333333333%}[class*=grid-]>[data-push-right*=off-2],[class*=grid_]>[data-push-right*=off-2],[class~=grid]>[data-push-right*=off-2]{margin-right:16.6666666667%}[class*=grid-]>[data-push-right*=off-3],[class*=grid_]>[data-push-right*=off-3],[class~=grid]>[data-push-right*=off-3]{margin-right:25%}[class*=grid-]>[data-push-right*=off-4],[class*=grid_]>[data-push-right*=off-4],[class~=grid]>[data-push-right*=off-4]{margin-right:33.3333333333%}[class*=grid-]>[data-push-right*=off-5],[class*=grid_]>[data-push-right*=off-5],[class~=grid]>[data-push-right*=off-5]{margin-right:41.6666666667%}[class*=grid-]>[data-push-right*=off-6],[class*=grid_]>[data-push-right*=off-6],[class~=grid]>[data-push-right*=off-6]{margin-right:50%}[class*=grid-]>[data-push-right*=off-7],[class*=grid_]>[data-push-right*=off-7],[class~=grid]>[data-push-right*=off-7]{margin-right:58.3333333333%}[class*=grid-]>[data-push-right*=off-8],[class*=grid_]>[data-push-right*=off-8],[class~=grid]>[data-push-right*=off-8]{margin-right:66.6666666667%}[class*=grid-]>[data-push-right*=off-9],[class*=grid_]>[data-push-right*=off-9],[class~=grid]>[data-push-right*=off-9]{margin-right:75%}[class*=grid-]>[data-push-right*=off-10],[class*=grid_]>[data-push-right*=off-10],[class~=grid]>[data-push-right*=off-10]{margin-right:83.3333333333%}[class*=grid-]>[data-push-right*=off-11],[class*=grid_]>[data-push-right*=off-11],[class~=grid]>[data-push-right*=off-11]{margin-right:91.6666666667%}@media (max-width:80em){[class*=grid-]>[class*=_lg-1],[class*=grid_]>[class*=_lg-1],[class~=grid]>[class*=_lg-1]{flex-basis:8.3333333333%;max-width:8.3333333333%}[class*=grid-]>[class*=_lg-2],[class*=grid_]>[class*=_lg-2],[class~=grid]>[class*=_lg-2]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=grid-]>[class*=_lg-3],[class*=grid_]>[class*=_lg-3],[class~=grid]>[class*=_lg-3]{flex-basis:25%;max-width:25%}[class*=grid-]>[class*=_lg-4],[class*=grid_]>[class*=_lg-4],[class~=grid]>[class*=_lg-4]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=grid-]>[class*=_lg-5],[class*=grid_]>[class*=_lg-5],[class~=grid]>[class*=_lg-5]{flex-basis:41.6666666667%;max-width:41.6666666667%}[class*=grid-]>[class*=_lg-6],[class*=grid_]>[class*=_lg-6],[class~=grid]>[class*=_lg-6]{flex-basis:50%;max-width:50%}[class*=grid-]>[class*=_lg-7],[class*=grid_]>[class*=_lg-7],[class~=grid]>[class*=_lg-7]{flex-basis:58.3333333333%;max-width:58.3333333333%}[class*=grid-]>[class*=_lg-8],[class*=grid_]>[class*=_lg-8],[class~=grid]>[class*=_lg-8]{flex-basis:66.6666666667%;max-width:66.6666666667%}[class*=grid-]>[class*=_lg-9],[class*=grid_]>[class*=_lg-9],[class~=grid]>[class*=_lg-9]{flex-basis:75%;max-width:75%}[class*=grid-]>[class*=_lg-10],[class*=grid_]>[class*=_lg-10],[class~=grid]>[class*=_lg-10]{flex-basis:83.3333333333%;max-width:83.3333333333%}[class*=grid-]>[class*=_lg-11],[class*=grid_]>[class*=_lg-11],[class~=grid]>[class*=_lg-11]{flex-basis:91.6666666667%;max-width:91.6666666667%}[class*=grid-]>[class*=_lg-12],[class*=grid_]>[class*=_lg-12],[class~=grid]>[class*=_lg-12]{flex-basis:100%;max-width:100%}[class*=grid-]>[data-push-left*=_lg-0],[class*=grid_]>[data-push-left*=_lg-0],[class~=grid]>[data-push-left*=_lg-0]{margin-left:0}[class*=grid-]>[data-push-left*=_lg-1],[class*=grid_]>[data-push-left*=_lg-1],[class~=grid]>[data-push-left*=_lg-1]{margin-left:8.3333333333%}[class*=grid-]>[data-push-left*=_lg-2],[class*=grid_]>[data-push-left*=_lg-2],[class~=grid]>[data-push-left*=_lg-2]{margin-left:16.6666666667%}[class*=grid-]>[data-push-left*=_lg-3],[class*=grid_]>[data-push-left*=_lg-3],[class~=grid]>[data-push-left*=_lg-3]{margin-left:25%}[class*=grid-]>[data-push-left*=_lg-4],[class*=grid_]>[data-push-left*=_lg-4],[class~=grid]>[data-push-left*=_lg-4]{margin-left:33.3333333333%}[class*=grid-]>[data-push-left*=_lg-5],[class*=grid_]>[data-push-left*=_lg-5],[class~=grid]>[data-push-left*=_lg-5]{margin-left:41.6666666667%}[class*=grid-]>[data-push-left*=_lg-6],[class*=grid_]>[data-push-left*=_lg-6],[class~=grid]>[data-push-left*=_lg-6]{margin-left:50%}[class*=grid-]>[data-push-left*=_lg-7],[class*=grid_]>[data-push-left*=_lg-7],[class~=grid]>[data-push-left*=_lg-7]{margin-left:58.3333333333%}[class*=grid-]>[data-push-left*=_lg-8],[class*=grid_]>[data-push-left*=_lg-8],[class~=grid]>[data-push-left*=_lg-8]{margin-left:66.6666666667%}[class*=grid-]>[data-push-left*=_lg-9],[class*=grid_]>[data-push-left*=_lg-9],[class~=grid]>[data-push-left*=_lg-9]{margin-left:75%}[class*=grid-]>[data-push-left*=_lg-10],[class*=grid_]>[data-push-left*=_lg-10],[class~=grid]>[data-push-left*=_lg-10]{margin-left:83.3333333333%}[class*=grid-]>[data-push-left*=_lg-11],[class*=grid_]>[data-push-left*=_lg-11],[class~=grid]>[data-push-left*=_lg-11]{margin-left:91.6666666667%}[class*=grid-]>[data-push-right*=_lg-0],[class*=grid_]>[data-push-right*=_lg-0],[class~=grid]>[data-push-right*=_lg-0]{margin-right:0}[class*=grid-]>[data-push-right*=_lg-1],[class*=grid_]>[data-push-right*=_lg-1],[class~=grid]>[data-push-right*=_lg-1]{margin-right:8.3333333333%}[class*=grid-]>[data-push-right*=_lg-2],[class*=grid_]>[data-push-right*=_lg-2],[class~=grid]>[data-push-right*=_lg-2]{margin-right:16.6666666667%}[class*=grid-]>[data-push-right*=_lg-3],[class*=grid_]>[data-push-right*=_lg-3],[class~=grid]>[data-push-right*=_lg-3]{margin-right:25%}[class*=grid-]>[data-push-right*=_lg-4],[class*=grid_]>[data-push-right*=_lg-4],[class~=grid]>[data-push-right*=_lg-4]{margin-right:33.3333333333%}[class*=grid-]>[data-push-right*=_lg-5],[class*=grid_]>[data-push-right*=_lg-5],[class~=grid]>[data-push-right*=_lg-5]{margin-right:41.6666666667%}[class*=grid-]>[data-push-right*=_lg-6],[class*=grid_]>[data-push-right*=_lg-6],[class~=grid]>[data-push-right*=_lg-6]{margin-right:50%}[class*=grid-]>[data-push-right*=_lg-7],[class*=grid_]>[data-push-right*=_lg-7],[class~=grid]>[data-push-right*=_lg-7]{margin-right:58.3333333333%}[class*=grid-]>[data-push-right*=_lg-8],[class*=grid_]>[data-push-right*=_lg-8],[class~=grid]>[data-push-right*=_lg-8]{margin-right:66.6666666667%}[class*=grid-]>[data-push-right*=_lg-9],[class*=grid_]>[data-push-right*=_lg-9],[class~=grid]>[data-push-right*=_lg-9]{margin-right:75%}[class*=grid-]>[data-push-right*=_lg-10],[class*=grid_]>[data-push-right*=_lg-10],[class~=grid]>[data-push-right*=_lg-10]{margin-right:83.3333333333%}[class*=grid-]>[data-push-right*=_lg-11],[class*=grid_]>[data-push-right*=_lg-11],[class~=grid]>[data-push-right*=_lg-11]{margin-right:91.6666666667%}[class*=grid-] [class*=_lg-first],[class*=grid_] [class*=_lg-first],[class~=grid] [class*=_lg-first]{order:-1}[class*=grid-] [class*=_lg-last],[class*=grid_] [class*=_lg-last],[class~=grid] [class*=_lg-last]{order:1}}@media (max-width:64em){[class*=grid-]>[class*=_md-1],[class*=grid_]>[class*=_md-1],[class~=grid]>[class*=_md-1]{flex-basis:8.3333333333%;max-width:8.3333333333%}[class*=grid-]>[class*=_md-2],[class*=grid_]>[class*=_md-2],[class~=grid]>[class*=_md-2]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=grid-]>[class*=_md-3],[class*=grid_]>[class*=_md-3],[class~=grid]>[class*=_md-3]{flex-basis:25%;max-width:25%}[class*=grid-]>[class*=_md-4],[class*=grid_]>[class*=_md-4],[class~=grid]>[class*=_md-4]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=grid-]>[class*=_md-5],[class*=grid_]>[class*=_md-5],[class~=grid]>[class*=_md-5]{flex-basis:41.6666666667%;max-width:41.6666666667%}[class*=grid-]>[class*=_md-6],[class*=grid_]>[class*=_md-6],[class~=grid]>[class*=_md-6]{flex-basis:50%;max-width:50%}[class*=grid-]>[class*=_md-7],[class*=grid_]>[class*=_md-7],[class~=grid]>[class*=_md-7]{flex-basis:58.3333333333%;max-width:58.3333333333%}[class*=grid-]>[class*=_md-8],[class*=grid_]>[class*=_md-8],[class~=grid]>[class*=_md-8]{flex-basis:66.6666666667%;max-width:66.6666666667%}[class*=grid-]>[class*=_md-9],[class*=grid_]>[class*=_md-9],[class~=grid]>[class*=_md-9]{flex-basis:75%;max-width:75%}[class*=grid-]>[class*=_md-10],[class*=grid_]>[class*=_md-10],[class~=grid]>[class*=_md-10]{flex-basis:83.3333333333%;max-width:83.3333333333%}[class*=grid-]>[class*=_md-11],[class*=grid_]>[class*=_md-11],[class~=grid]>[class*=_md-11]{flex-basis:91.6666666667%;max-width:91.6666666667%}[class*=grid-]>[class*=_md-12],[class*=grid_]>[class*=_md-12],[class~=grid]>[class*=_md-12]{flex-basis:100%;max-width:100%}[class*=grid-]>[data-push-left*=_md-0],[class*=grid_]>[data-push-left*=_md-0],[class~=grid]>[data-push-left*=_md-0]{margin-left:0}[class*=grid-]>[data-push-left*=_md-1],[class*=grid_]>[data-push-left*=_md-1],[class~=grid]>[data-push-left*=_md-1]{margin-left:8.3333333333%}[class*=grid-]>[data-push-left*=_md-2],[class*=grid_]>[data-push-left*=_md-2],[class~=grid]>[data-push-left*=_md-2]{margin-left:16.6666666667%}[class*=grid-]>[data-push-left*=_md-3],[class*=grid_]>[data-push-left*=_md-3],[class~=grid]>[data-push-left*=_md-3]{margin-left:25%}[class*=grid-]>[data-push-left*=_md-4],[class*=grid_]>[data-push-left*=_md-4],[class~=grid]>[data-push-left*=_md-4]{margin-left:33.3333333333%}[class*=grid-]>[data-push-left*=_md-5],[class*=grid_]>[data-push-left*=_md-5],[class~=grid]>[data-push-left*=_md-5]{margin-left:41.6666666667%}[class*=grid-]>[data-push-left*=_md-6],[class*=grid_]>[data-push-left*=_md-6],[class~=grid]>[data-push-left*=_md-6]{margin-left:50%}[class*=grid-]>[data-push-left*=_md-7],[class*=grid_]>[data-push-left*=_md-7],[class~=grid]>[data-push-left*=_md-7]{margin-left:58.3333333333%}[class*=grid-]>[data-push-left*=_md-8],[class*=grid_]>[data-push-left*=_md-8],[class~=grid]>[data-push-left*=_md-8]{margin-left:66.6666666667%}[class*=grid-]>[data-push-left*=_md-9],[class*=grid_]>[data-push-left*=_md-9],[class~=grid]>[data-push-left*=_md-9]{margin-left:75%}[class*=grid-]>[data-push-left*=_md-10],[class*=grid_]>[data-push-left*=_md-10],[class~=grid]>[data-push-left*=_md-10]{margin-left:83.3333333333%}[class*=grid-]>[data-push-left*=_md-11],[class*=grid_]>[data-push-left*=_md-11],[class~=grid]>[data-push-left*=_md-11]{margin-left:91.6666666667%}[class*=grid-]>[data-push-right*=_md-0],[class*=grid_]>[data-push-right*=_md-0],[class~=grid]>[data-push-right*=_md-0]{margin-right:0}[class*=grid-]>[data-push-right*=_md-1],[class*=grid_]>[data-push-right*=_md-1],[class~=grid]>[data-push-right*=_md-1]{margin-right:8.3333333333%}[class*=grid-]>[data-push-right*=_md-2],[class*=grid_]>[data-push-right*=_md-2],[class~=grid]>[data-push-right*=_md-2]{margin-right:16.6666666667%}[class*=grid-]>[data-push-right*=_md-3],[class*=grid_]>[data-push-right*=_md-3],[class~=grid]>[data-push-right*=_md-3]{margin-right:25%}[class*=grid-]>[data-push-right*=_md-4],[class*=grid_]>[data-push-right*=_md-4],[class~=grid]>[data-push-right*=_md-4]{margin-right:33.3333333333%}[class*=grid-]>[data-push-right*=_md-5],[class*=grid_]>[data-push-right*=_md-5],[class~=grid]>[data-push-right*=_md-5]{margin-right:41.6666666667%}[class*=grid-]>[data-push-right*=_md-6],[class*=grid_]>[data-push-right*=_md-6],[class~=grid]>[data-push-right*=_md-6]{margin-right:50%}[class*=grid-]>[data-push-right*=_md-7],[class*=grid_]>[data-push-right*=_md-7],[class~=grid]>[data-push-right*=_md-7]{margin-right:58.3333333333%}[class*=grid-]>[data-push-right*=_md-8],[class*=grid_]>[data-push-right*=_md-8],[class~=grid]>[data-push-right*=_md-8]{margin-right:66.6666666667%}[class*=grid-]>[data-push-right*=_md-9],[class*=grid_]>[data-push-right*=_md-9],[class~=grid]>[data-push-right*=_md-9]{margin-right:75%}[class*=grid-]>[data-push-right*=_md-10],[class*=grid_]>[data-push-right*=_md-10],[class~=grid]>[data-push-right*=_md-10]{margin-right:83.3333333333%}[class*=grid-]>[data-push-right*=_md-11],[class*=grid_]>[data-push-right*=_md-11],[class~=grid]>[data-push-right*=_md-11]{margin-right:91.6666666667%}[class*=grid-] [class*=_md-first],[class*=grid_] [class*=_md-first],[class~=grid] [class*=_md-first]{order:-1}[class*=grid-] [class*=_md-last],[class*=grid_] [class*=_md-last],[class~=grid] [class*=_md-last]{order:1}}@media (max-width:48em){[class*=grid-]>[class*=_sm-1],[class*=grid_]>[class*=_sm-1],[class~=grid]>[class*=_sm-1]{flex-basis:8.3333333333%;max-width:8.3333333333%}[class*=grid-]>[class*=_sm-2],[class*=grid_]>[class*=_sm-2],[class~=grid]>[class*=_sm-2]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=grid-]>[class*=_sm-3],[class*=grid_]>[class*=_sm-3],[class~=grid]>[class*=_sm-3]{flex-basis:25%;max-width:25%}[class*=grid-]>[class*=_sm-4],[class*=grid_]>[class*=_sm-4],[class~=grid]>[class*=_sm-4]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=grid-]>[class*=_sm-5],[class*=grid_]>[class*=_sm-5],[class~=grid]>[class*=_sm-5]{flex-basis:41.6666666667%;max-width:41.6666666667%}[class*=grid-]>[class*=_sm-6],[class*=grid_]>[class*=_sm-6],[class~=grid]>[class*=_sm-6]{flex-basis:50%;max-width:50%}[class*=grid-]>[class*=_sm-7],[class*=grid_]>[class*=_sm-7],[class~=grid]>[class*=_sm-7]{flex-basis:58.3333333333%;max-width:58.3333333333%}[class*=grid-]>[class*=_sm-8],[class*=grid_]>[class*=_sm-8],[class~=grid]>[class*=_sm-8]{flex-basis:66.6666666667%;max-width:66.6666666667%}[class*=grid-]>[class*=_sm-9],[class*=grid_]>[class*=_sm-9],[class~=grid]>[class*=_sm-9]{flex-basis:75%;max-width:75%}[class*=grid-]>[class*=_sm-10],[class*=grid_]>[class*=_sm-10],[class~=grid]>[class*=_sm-10]{flex-basis:83.3333333333%;max-width:83.3333333333%}[class*=grid-]>[class*=_sm-11],[class*=grid_]>[class*=_sm-11],[class~=grid]>[class*=_sm-11]{flex-basis:91.6666666667%;max-width:91.6666666667%}[class*=grid-]>[class*=_sm-12],[class*=grid_]>[class*=_sm-12],[class~=grid]>[class*=_sm-12]{flex-basis:100%;max-width:100%}[class*=grid-]>[data-push-left*=_sm-0],[class*=grid_]>[data-push-left*=_sm-0],[class~=grid]>[data-push-left*=_sm-0]{margin-left:0}[class*=grid-]>[data-push-left*=_sm-1],[class*=grid_]>[data-push-left*=_sm-1],[class~=grid]>[data-push-left*=_sm-1]{margin-left:8.3333333333%}[class*=grid-]>[data-push-left*=_sm-2],[class*=grid_]>[data-push-left*=_sm-2],[class~=grid]>[data-push-left*=_sm-2]{margin-left:16.6666666667%}[class*=grid-]>[data-push-left*=_sm-3],[class*=grid_]>[data-push-left*=_sm-3],[class~=grid]>[data-push-left*=_sm-3]{margin-left:25%}[class*=grid-]>[data-push-left*=_sm-4],[class*=grid_]>[data-push-left*=_sm-4],[class~=grid]>[data-push-left*=_sm-4]{margin-left:33.3333333333%}[class*=grid-]>[data-push-left*=_sm-5],[class*=grid_]>[data-push-left*=_sm-5],[class~=grid]>[data-push-left*=_sm-5]{margin-left:41.6666666667%}[class*=grid-]>[data-push-left*=_sm-6],[class*=grid_]>[data-push-left*=_sm-6],[class~=grid]>[data-push-left*=_sm-6]{margin-left:50%}[class*=grid-]>[data-push-left*=_sm-7],[class*=grid_]>[data-push-left*=_sm-7],[class~=grid]>[data-push-left*=_sm-7]{margin-left:58.3333333333%}[class*=grid-]>[data-push-left*=_sm-8],[class*=grid_]>[data-push-left*=_sm-8],[class~=grid]>[data-push-left*=_sm-8]{margin-left:66.6666666667%}[class*=grid-]>[data-push-left*=_sm-9],[class*=grid_]>[data-push-left*=_sm-9],[class~=grid]>[data-push-left*=_sm-9]{margin-left:75%}[class*=grid-]>[data-push-left*=_sm-10],[class*=grid_]>[data-push-left*=_sm-10],[class~=grid]>[data-push-left*=_sm-10]{margin-left:83.3333333333%}[class*=grid-]>[data-push-left*=_sm-11],[class*=grid_]>[data-push-left*=_sm-11],[class~=grid]>[data-push-left*=_sm-11]{margin-left:91.6666666667%}[class*=grid-]>[data-push-right*=_sm-0],[class*=grid_]>[data-push-right*=_sm-0],[class~=grid]>[data-push-right*=_sm-0]{margin-right:0}[class*=grid-]>[data-push-right*=_sm-1],[class*=grid_]>[data-push-right*=_sm-1],[class~=grid]>[data-push-right*=_sm-1]{margin-right:8.3333333333%}[class*=grid-]>[data-push-right*=_sm-2],[class*=grid_]>[data-push-right*=_sm-2],[class~=grid]>[data-push-right*=_sm-2]{margin-right:16.6666666667%}[class*=grid-]>[data-push-right*=_sm-3],[class*=grid_]>[data-push-right*=_sm-3],[class~=grid]>[data-push-right*=_sm-3]{margin-right:25%}[class*=grid-]>[data-push-right*=_sm-4],[class*=grid_]>[data-push-right*=_sm-4],[class~=grid]>[data-push-right*=_sm-4]{margin-right:33.3333333333%}[class*=grid-]>[data-push-right*=_sm-5],[class*=grid_]>[data-push-right*=_sm-5],[class~=grid]>[data-push-right*=_sm-5]{margin-right:41.6666666667%}[class*=grid-]>[data-push-right*=_sm-6],[class*=grid_]>[data-push-right*=_sm-6],[class~=grid]>[data-push-right*=_sm-6]{margin-right:50%}[class*=grid-]>[data-push-right*=_sm-7],[class*=grid_]>[data-push-right*=_sm-7],[class~=grid]>[data-push-right*=_sm-7]{margin-right:58.3333333333%}[class*=grid-]>[data-push-right*=_sm-8],[class*=grid_]>[data-push-right*=_sm-8],[class~=grid]>[data-push-right*=_sm-8]{margin-right:66.6666666667%}[class*=grid-]>[data-push-right*=_sm-9],[class*=grid_]>[data-push-right*=_sm-9],[class~=grid]>[data-push-right*=_sm-9]{margin-right:75%}[class*=grid-]>[data-push-right*=_sm-10],[class*=grid_]>[data-push-right*=_sm-10],[class~=grid]>[data-push-right*=_sm-10]{margin-right:83.3333333333%}[class*=grid-]>[data-push-right*=_sm-11],[class*=grid_]>[data-push-right*=_sm-11],[class~=grid]>[data-push-right*=_sm-11]{margin-right:91.6666666667%}[class*=grid-] [class*=_sm-first],[class*=grid_] [class*=_sm-first],[class~=grid] [class*=_sm-first]{order:-1}[class*=grid-] [class*=_sm-last],[class*=grid_] [class*=_sm-last],[class~=grid] [class*=_sm-last]{order:1}}@media (max-width:36em){[class*=grid-]>[class*=_xs-1],[class*=grid_]>[class*=_xs-1],[class~=grid]>[class*=_xs-1]{flex-basis:8.3333333333%;max-width:8.3333333333%}[class*=grid-]>[class*=_xs-2],[class*=grid_]>[class*=_xs-2],[class~=grid]>[class*=_xs-2]{flex-basis:16.6666666667%;max-width:16.6666666667%}[class*=grid-]>[class*=_xs-3],[class*=grid_]>[class*=_xs-3],[class~=grid]>[class*=_xs-3]{flex-basis:25%;max-width:25%}[class*=grid-]>[class*=_xs-4],[class*=grid_]>[class*=_xs-4],[class~=grid]>[class*=_xs-4]{flex-basis:33.3333333333%;max-width:33.3333333333%}[class*=grid-]>[class*=_xs-5],[class*=grid_]>[class*=_xs-5],[class~=grid]>[class*=_xs-5]{flex-basis:41.6666666667%;max-width:41.6666666667%}[class*=grid-]>[class*=_xs-6],[class*=grid_]>[class*=_xs-6],[class~=grid]>[class*=_xs-6]{flex-basis:50%;max-width:50%}[class*=grid-]>[class*=_xs-7],[class*=grid_]>[class*=_xs-7],[class~=grid]>[class*=_xs-7]{flex-basis:58.3333333333%;max-width:58.3333333333%}[class*=grid-]>[class*=_xs-8],[class*=grid_]>[class*=_xs-8],[class~=grid]>[class*=_xs-8]{flex-basis:66.6666666667%;max-width:66.6666666667%}[class*=grid-]>[class*=_xs-9],[class*=grid_]>[class*=_xs-9],[class~=grid]>[class*=_xs-9]{flex-basis:75%;max-width:75%}[class*=grid-]>[class*=_xs-10],[class*=grid_]>[class*=_xs-10],[class~=grid]>[class*=_xs-10]{flex-basis:83.3333333333%;max-width:83.3333333333%}[class*=grid-]>[class*=_xs-11],[class*=grid_]>[class*=_xs-11],[class~=grid]>[class*=_xs-11]{flex-basis:91.6666666667%;max-width:91.6666666667%}[class*=grid-]>[class*=_xs-12],[class*=grid_]>[class*=_xs-12],[class~=grid]>[class*=_xs-12]{flex-basis:100%;max-width:100%}[class*=grid-]>[data-push-left*=_xs-0],[class*=grid_]>[data-push-left*=_xs-0],[class~=grid]>[data-push-left*=_xs-0]{margin-left:0}[class*=grid-]>[data-push-left*=_xs-1],[class*=grid_]>[data-push-left*=_xs-1],[class~=grid]>[data-push-left*=_xs-1]{margin-left:8.3333333333%}[class*=grid-]>[data-push-left*=_xs-2],[class*=grid_]>[data-push-left*=_xs-2],[class~=grid]>[data-push-left*=_xs-2]{margin-left:16.6666666667%}[class*=grid-]>[data-push-left*=_xs-3],[class*=grid_]>[data-push-left*=_xs-3],[class~=grid]>[data-push-left*=_xs-3]{margin-left:25%}[class*=grid-]>[data-push-left*=_xs-4],[class*=grid_]>[data-push-left*=_xs-4],[class~=grid]>[data-push-left*=_xs-4]{margin-left:33.3333333333%}[class*=grid-]>[data-push-left*=_xs-5],[class*=grid_]>[data-push-left*=_xs-5],[class~=grid]>[data-push-left*=_xs-5]{margin-left:41.6666666667%}[class*=grid-]>[data-push-left*=_xs-6],[class*=grid_]>[data-push-left*=_xs-6],[class~=grid]>[data-push-left*=_xs-6]{margin-left:50%}[class*=grid-]>[data-push-left*=_xs-7],[class*=grid_]>[data-push-left*=_xs-7],[class~=grid]>[data-push-left*=_xs-7]{margin-left:58.3333333333%}[class*=grid-]>[data-push-left*=_xs-8],[class*=grid_]>[data-push-left*=_xs-8],[class~=grid]>[data-push-left*=_xs-8]{margin-left:66.6666666667%}[class*=grid-]>[data-push-left*=_xs-9],[class*=grid_]>[data-push-left*=_xs-9],[class~=grid]>[data-push-left*=_xs-9]{margin-left:75%}[class*=grid-]>[data-push-left*=_xs-10],[class*=grid_]>[data-push-left*=_xs-10],[class~=grid]>[data-push-left*=_xs-10]{margin-left:83.3333333333%}[class*=grid-]>[data-push-left*=_xs-11],[class*=grid_]>[data-push-left*=_xs-11],[class~=grid]>[data-push-left*=_xs-11]{margin-left:91.6666666667%}[class*=grid-]>[data-push-right*=_xs-0],[class*=grid_]>[data-push-right*=_xs-0],[class~=grid]>[data-push-right*=_xs-0]{margin-right:0}[class*=grid-]>[data-push-right*=_xs-1],[class*=grid_]>[data-push-right*=_xs-1],[class~=grid]>[data-push-right*=_xs-1]{margin-right:8.3333333333%}[class*=grid-]>[data-push-right*=_xs-2],[class*=grid_]>[data-push-right*=_xs-2],[class~=grid]>[data-push-right*=_xs-2]{margin-right:16.6666666667%}[class*=grid-]>[data-push-right*=_xs-3],[class*=grid_]>[data-push-right*=_xs-3],[class~=grid]>[data-push-right*=_xs-3]{margin-right:25%}[class*=grid-]>[data-push-right*=_xs-4],[class*=grid_]>[data-push-right*=_xs-4],[class~=grid]>[data-push-right*=_xs-4]{margin-right:33.3333333333%}[class*=grid-]>[data-push-right*=_xs-5],[class*=grid_]>[data-push-right*=_xs-5],[class~=grid]>[data-push-right*=_xs-5]{margin-right:41.6666666667%}[class*=grid-]>[data-push-right*=_xs-6],[class*=grid_]>[data-push-right*=_xs-6],[class~=grid]>[data-push-right*=_xs-6]{margin-right:50%}[class*=grid-]>[data-push-right*=_xs-7],[class*=grid_]>[data-push-right*=_xs-7],[class~=grid]>[data-push-right*=_xs-7]{margin-right:58.3333333333%}[class*=grid-]>[data-push-right*=_xs-8],[class*=grid_]>[data-push-right*=_xs-8],[class~=grid]>[data-push-right*=_xs-8]{margin-right:66.6666666667%}[class*=grid-]>[data-push-right*=_xs-9],[class*=grid_]>[data-push-right*=_xs-9],[class~=grid]>[data-push-right*=_xs-9]{margin-right:75%}[class*=grid-]>[data-push-right*=_xs-10],[class*=grid_]>[data-push-right*=_xs-10],[class~=grid]>[data-push-right*=_xs-10]{margin-right:83.3333333333%}[class*=grid-]>[data-push-right*=_xs-11],[class*=grid_]>[data-push-right*=_xs-11],[class~=grid]>[data-push-right*=_xs-11]{margin-right:91.6666666667%}[class*=grid-] [class*=_xs-first],[class*=grid_] [class*=_xs-first],[class~=grid] [class*=_xs-first]{order:-1}[class*=grid-] [class*=_xs-last],[class*=grid_] [class*=_xs-last],[class~=grid] [class*=_xs-last]{order:1}}@media (max-width:80em){[class*=lg-hidden]{display:none}}@media (max-width:64em){[class*=md-hidden]{display:none}}@media (max-width:48em){[class*=sm-hidden]{display:none}}@media (max-width:36em){[class*=xs-hidden]{display:none}}body{font-family:"Open Sans",sans-serif;-webkit-font-smoothing:antialiased}.hide{display:none;position:absolute;border:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(0 0 0 0)}.max-width-sm{max-width:720px;margin:0 auto;width:100%}.max-width-md{max-width:960px;margin:0 auto;width:100%}.max-width-lg{max-width:1100px;margin:0 auto;width:100%}[style*="--aspect-ratio"]>:first-child{width:100%}[style*="--aspect-ratio"]>img{height:auto}@supports (--custom:property){[style*="--aspect-ratio"]{position:relative}[style*="--aspect-ratio"]::before{content:"";display:block;padding-bottom:calc(100% / (var(--aspect-ratio)))}[style*="--aspect-ratio"]>:first-child{position:absolute;top:0;left:0;height:100%}}.scroll{overflow-y:hidden}.scroll:hover{overflow-y:auto}.scroll:hover::-webkit-scrollbar{width:5px}.scroll:hover::-webkit-scrollbar-track{background:0 0}.scroll:hover::-webkit-scrollbar-thumb{background-color:#ccc;border-left:1px solid transparent;border-right:1px solid transparent;border-radius:2px;background-clip:content-box}.scalable-container{display:flex;justify-content:center}.scalable-container .scalable-wrapper{resize:both;position:relative;background:#eee;border:3px solid #e0e0e0;height:400px;cursor:default}.scalable-container .scalable-wrapper .scalable-preview{width:1200px;position:relative;left:50%;top:50%;transform:translate(-50%,-50%) scale(.4);transform-origin:center center}.scalable-container .scalable-wrapper.active{border:3px solid #3670d0}.scalable-container .scalable-wrapper.active:before{position:absolute;top:0;right:0;bottom:0;left:0;content:"";display:block;background:#3670d0;opacity:.4}.scalable-container .scalable-wrapper.hovered{border:3px dotted #3670d0}.scalable-container .scalable-wrapper.hovered:before{position:absolute;top:0;right:0;bottom:0;left:0;content:"";display:block;background:#3670d0;opacity:.2}.cards-view .post-list{width:100%;padding-top:60px;padding-bottom:60px;margin:0}.cards-view .post-list .col{padding:15px 15px}.cards-view .post-card{display:flex;flex-direction:column;justify-content:space-between;background-color:#fff;border-radius:8px;box-shadow:rgba(39,44,49,.06) 8px 14px 38px,rgba(39,44,49,.03) 1px 3px 8px;transition:all .5s ease}.cards-view .post-card:hover{box-shadow:rgba(39,44,49,.07) 8px 28px 50px,rgba(39,44,49,.04) 1px 6px 12px;transition:all .4s ease;transform:translate3D(0,-1px,0) scale(1.02)}.cards-view .post-card .thumbnail img{width:100%;border-top-left-radius:8px;border-top-right-radius:8px}.cards-view .post-card .icon-draft{width:16px;height:16px;margin-left:5px;position:relative;top:1px}.cards-view .post-card a{text-decoration:none;color:#313131;cursor:pointer}.cards-view .post-card .title{margin:20px;line-height:1.5}.cards-view .post-card .brief{margin:20px;font-size:14px;line-height:1.5}.list-view .post-list{width:100%;padding-top:60px;padding-bottom:60px;margin:0}.list-view .post-list .col{padding:15px 15px}.list-view .post-card{display:flex;background-color:#fff;border-radius:8px;box-shadow:rgba(39,44,49,.06) 8px 14px 38px,rgba(39,44,49,.03) 1px 3px 8px;transition:all .5s ease}.list-view .post-card:hover{box-shadow:rgba(39,44,49,.07) 8px 28px 50px,rgba(39,44,49,.04) 1px 6px 12px;transition:all .4s ease;transform:translate3D(0,-1px,0) scale(1.02)}.list-view .post-card .thumbnail a{display:block;padding:20px 0 20px 20px}.list-view .post-card .thumbnail a img{width:240px}.list-view .post-card .post-body{width:100%;display:flex;flex-direction:column;justify-content:space-between}.list-view .post-card .post-body .icon-draft{width:16px;height:16px;margin-left:5px;position:relative;top:1px}.list-view .post-card a{text-decoration:none;color:#313131;cursor:pointer}.list-view .post-card .title{margin:20px;line-height:1.5}.list-view .post-card .brief{margin:20px;font-size:14px;line-height:1.5}.cards-view .post-card .post-footer,.list-view .post-card .post-footer{display:flex;align-items:center;justify-content:space-between;margin:0 20px 20px}.cards-view .post-card .post-footer .meta,.list-view .post-card .post-footer .meta{display:flex;align-items:center}.cards-view .post-card .post-footer img,.list-view .post-card .post-footer img{width:32px;height:32px;border-radius:18px;border:1px solid #c3c3c3}.cards-view .post-card .post-footer .created,.list-view .post-card .post-footer .created{margin-left:8px;font-size:12px;color:#aaa}.cards-view .post-card .post-footer .reading-time,.list-view .post-card .post-footer .reading-time{font-size:12px;color:#5ba13f}.empty-msg{color:#a9a9a9;display:flex;flex-direction:column;align-items:center;padding-top:60px;padding-bottom:60px}.empty-msg img{width:48px}.empty-msg span{font-size:18px;margin-top:10px}.loading{text-align:center;display:none}.loading svg path,.loading svg rect{fill:#ff6700}.search-box{display:flex;align-items:center;padding-left:10px;padding-right:10px;box-sizing:border-box;background:#3c3f41;border-radius:3px;-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.03);box-shadow:0 1px 2px 0 rgba(0,0,0,.03);-webkit-transition:background .4s,-webkit-box-shadow .2s;transition:background .4s,-webkit-box-shadow .2s;-o-transition:background .4s,box-shadow .2s;transition:background .4s,box-shadow .2s;transition:background .4s,box-shadow .2s,-webkit-box-shadow .2s}.search-box .search-icon{width:14px;height:14px;z-index:1;fill:#c3c3c3}.search-box input[type=search]{width:100%;box-sizing:border-box;padding:10px 10px 10px 8px;background:0 0;border:none;outline:0;color:#c3c3c3}.article-body{line-height:2;font-size:16px;padding-top:0;padding-bottom:60px}.article-body h1,.article-body h2,.article-body h3,.article-body h4,.article-body h5,.article-body h6{font-weight:500}.article-body h1{color:#444;margin-top:40px;font-size:26px}.article-body h1:first-child{margin-top:0}.article-body h2{margin-top:34px;font-size:22px;color:#555}.article-body h3{color:#666;font-size:18px}.article-body h4{color:#777;font-size:16px}.article-body hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.article-body figure{margin:0}.article-body img{max-width:100%}.article-body a{color:#5ba13f;text-decoration:none;font-size:14px}.article-body p{margin:0 0 30px}.article-body blockquote{background-color:#f1f8e9;border-left:4px solid #9ccc65;padding:15px;margin:30px 0}.article-body code,.article-body pre{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:13px}.article-body pre{display:block;margin:0 0 10px;white-space:pre-wrap;word-break:break-all;word-wrap:break-word;line-height:1.45;overflow:auto!important;padding:16px;background:#000000;border-radius:4px;-webkit-box-shadow:0 0 10px #f1f8e9;box-shadow:0 0 10px #f1f8e9}.article-body li>code,.article-body p>code{padding:.2em .5em;margin:0;font-size:85%;background-color:#f1f8e9;color:#333;-webkit-border-radius:3px;border-radius:3px;white-space:normal}.article-body li.task-item{list-style:none;margin-left:-20px}.article-body li.task-item input[type=checkbox]{margin-right:5px}.article-body table{border-collapse:collapse;margin-bottom:30px}.article-body table td,.article-body table th{border:1px solid #dfe2e5;padding:10px 20px}.article-body table.two-col-text{border:none}.article-body table.two-col-text td,.article-body table.two-col-text th{border:none;vertical-align:top;padding:0}.nav{display:flex;align-content:center;align-items:center;background:#313131}.nav a{color:#c6c6c6;text-decoration:none}.nav .nav__content{display:flex;align-content:center;align-items:center;justify-content:space-between;font-size:13px;font-weight:700;height:auto;padding-top:15px;padding-bottom:15px}.nav .nav__content .nav__btn{border-radius:3px;border:1px solid #fff;padding:5px 10px 5px}.nav .nav__content .nav__content__left{display:flex;align-content:center;align-items:center}.nav .nav__content .nav__content__left .nav__header{display:flex;align-content:center;align-items:center;justify-content:space-between}.nav .nav__content .nav__content__left .nav__header .logo{display:flex;align-content:center;align-items:center;margin-right:40px;font-weight:700}.nav .nav__content .nav__content__left .nav__header .logo .logo__img{height:32px;margin-right:5px}.nav .nav__content .nav__content__left .nav__header .logo .logo__name{font-size:14px}.nav .nav__content .nav__content__left .nav__header .logo .superscript{position:relative;top:-5px;left:3px;color:#cc7832;font-size:10px;font-style:italic}.nav .nav__content .nav__content__left .nav__header .nav__menu-toggle{display:none}.nav .nav__content .nav__content__left .nav__header .nav__menu-toggle .nav__menu-icon{width:26px;fill:#c6c6c6}.nav .nav__content .nav__content__left .nav__menus a{margin-right:35px}.nav .nav__content .nav__content__left .nav__menus .search-box{width:300px}.nav .nav__content .nav__content__right{display:flex;align-content:center;align-items:center}.nav .nav__content .nav__content__right a{margin-left:20px}.nav .nav__content .nav__content__right .nav__user{display:flex;align-content:center;align-items:center}.nav .nav__content .nav__content__right .nav__user .nav__user__img{width:16px;margin-right:5px}@media screen and (max-width:1024px){.nav:not(.preview){padding:0 20px}.nav:not(.preview) .nav__content .nav__content__left .nav__menus a{margin-right:25px}}@media screen and (max-width:768px){.nav:not(.preview) .nav__content{flex-direction:column;align-content:flex-start;align-items:flex-start;height:auto;padding-top:initial;padding-bottom:initial}.nav:not(.preview) .nav__content .nav__content__left{flex-direction:column;align-content:flex-start;align-items:flex-start;width:100%}.nav:not(.preview) .nav__content .nav__content__left .nav__header{width:100%}.nav:not(.preview) .nav__content .nav__content__left .nav__header .logo{margin:15px 0 15px}.nav:not(.preview) .nav__content .nav__content__left .nav__header .nav__menu-toggle{display:block;margin:15px 0 15px;cursor:pointer}.nav:not(.preview) .nav__content .nav__content__left .nav__menus{display:none;flex-direction:column;margin-top:10px;width:100%}.nav:not(.preview) .nav__content .nav__content__left .nav__menus a{margin-left:30px;margin-bottom:20px}.nav:not(.preview) .nav__content .nav__content__left .nav__menus .search-box{width:100%;margin-bottom:15px}.nav:not(.preview) .nav__content .nav__content__left #menu-toggle-1:checked+.nav__menus{display:flex}.nav:not(.preview) .nav__content .nav__content__right{display:none;flex-direction:column;align-content:flex-start;align-items:flex-start;margin-bottom:10px}.nav:not(.preview) .nav__content .nav__content__right a{margin-left:30px;margin-bottom:20px}.nav:not(.preview) .nav__content #menu-toggle-2:checked+.nav__content__right{display:flex}}.hero{display:flex;align-content:center;align-items:center;position:relative;background-size:cover;background:#f8fafc url(../images/top_background.jpg) no-repeat center;color:#ccc}.hero .hero__content{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:540px;text-align:center}.hero .hero__content .hero__title{font-weight:400;font-size:32px;margin-top:0;line-height:1.3;margin-left:20px;margin-right:20px}.hero .hero__content .hero__subtitle{font-size:20px;line-height:1.4;max-width:768px;margin-left:20px;margin-right:20px;margin-top:0}.hero .hero__content .hero__subtitle a{color:#95bff4;text-decoration:none}.hero .hero__content .search-panel{width:100%;padding:30px 100px;box-sizing:border-box}.hero .hero__content .search-panel .search-box{padding:3px 15px;background-color:#555;font-size:14px}.hero .hero__content .search-panel .search-box .search-icon{fill:#fff}.hero .hero__content .search-panel .search-box input[type=search]{color:#fff}.hero .hero__content .search-panel .search-box input[type=search]::placeholder{color:#ccc;opacity:1}.hero .hero__content .search-panel .search-box input[type=search]:-ms-input-placeholder{color:#ccc}.hero .hero__content .search-panel .search-box input[type=search]::-ms-input-placeholder{color:#ccc}.hero .hero__content .btn-panel{display:flex;margin-top:40px}.hero .hero__content .btn-panel .btn{font-size:18px;text-decoration:none;border-radius:5px;text-shadow:0 -1px 0 rgba(0,0,0,.1)}.hero .hero__content .btn-panel .btn-action{color:#fff;fill:#fff;padding:15px 30px 15px;background:linear-gradient(#99bf38,#83a333);box-shadow:0 1px 0 rgba(0,0,0,.12)}.hero .hero__content .btn-panel .btn-video{color:#fff;padding:15px;border:1px solid #f1f1f1;border-radius:5px;margin-left:20px;display:flex;align-items:center;justify-content:center}.hero .hero__content .btn-panel .btn-video svg{fill:#fff;width:16px;margin-right:8px}.hero:before{position:absolute;top:0;right:0;bottom:0;left:0;content:"";display:block;background:radial-gradient(circle farthest-corner at right bottom,#313131 0,#313131 100%);opacity:.9}@media screen and (max-width:568px){.hero:not(.preview) .hero__content .search-panel{padding:20px}.hero:not(.preview) .hero__content .btn-panel{flex-direction:column;justify-items:center}.hero:not(.preview) .hero__content .btn-panel .btn-video{margin-left:0;margin-top:20px}}.nav-hero{position:relative;background-image:url(../images/top_background.jpg);background-size:cover;background-position:center;background-repeat:no-repeat}.nav-hero .nav{position:relative;background:0 0}.nav-hero .hero{position:relative;background:0 0;color:#c3c3c3}.nav-hero .hero:before{opacity:0}.nav-hero:before{position:absolute;top:0;right:0;bottom:0;left:0;content:"";display:block;background:radial-gradient(circle farthest-corner at right bottom,#313131 0,#313131 100%);opacity:.9}.prod-show{background-color:#f0f0f0}.prod-show .prod-show__content{background-image:url(../images/illustration-bg-1.svg);background-position:bottom;background-size:contain;background-repeat:no-repeat}.prod-show .prod-show__content .show-area{padding-left:20px;padding-right:20px;max-width:100%;text-align:center}.prod-show .prod-show__content .show-area img{position:relative;top:-80px;border-radius:5px;max-width:100%;box-shadow:0 32px 64px rgba(16,22,65,.24)}@media screen and (max-width:768px){.prod-show:not(.preview) .prod-show__content .show-area{padding-left:25px;padding-right:25px}.prod-show:not(.preview) .prod-show__content .show-area img{top:-60px}}@media screen and (max-width:568px){.prod-show:not(.preview) .prod-show__content .show-area{padding-left:15px;padding-right:15px}.prod-show:not(.preview) .prod-show__content .show-area img{top:-40px}}.illustration{display:flex;align-content:center;align-items:center;position:relative;color:#474b7e;background-color:#f8fafc}.illustration .illustration__content{position:relative;display:flex;height:540px;background-size:auto 90%;background-image:url(../images/illustration-02-idea.svg);background-repeat:no-repeat;background-position:right}.illustration .illustration__content .info{display:flex;flex-direction:column;justify-content:center;width:50%}.illustration .illustration__content .info .hero__title{font-weight:400;font-size:32px;margin-top:0;line-height:1.3}.illustration .illustration__content .info .hero__subtitle{font-size:20px;line-height:1.3;max-width:768px;margin-top:0;color:#6c6c6c}.illustration .illustration__content .info .hero__subtitle a{color:#589df6;text-decoration:none}.illustration .illustration__content .info .btn-panel{display:flex;margin-top:40px}.illustration .illustration__content .info .btn-panel .btn{font-size:18px;text-decoration:none;border-radius:5px;text-shadow:0 -1px 0 rgba(0,0,0,.1)}.illustration .illustration__content .info .btn-panel .btn-action{color:#fff;fill:#fff;padding:15px 30px 15px;background:linear-gradient(#676db6,#5f64a7);box-shadow:0 1px 0 rgba(0,0,0,.12)}.illustration .illustration__content .info .btn-panel .btn-video{color:#6c6c6c;padding:15px;border:1px solid #6c6c6c;border-radius:5px;margin-left:20px;display:flex;align-items:center;justify-content:center}.illustration .illustration__content .info .btn-panel .btn-video svg{fill:#6c6c6c;width:16px;margin-right:10px}@media screen and (max-width:1024px){.illustration:not(.preview){padding:0 20px}}@media screen and (max-width:768px){.illustration:not(.preview) .illustration__content{justify-content:left}.illustration:not(.preview) .illustration__content .info .btn-panel{flex-direction:column;justify-items:center;width:fit-content;text-align:center}.illustration:not(.preview) .illustration__content .info .btn-panel .btn-video{margin-left:0;margin-top:20px}}@media screen and (max-width:568px){.illustration:not(.preview) .illustration__content{height:940px;align-items:flex-start;background-size:contain;background-position:bottom}.illustration:not(.preview) .illustration__content .info{width:auto;align-items:center;text-align:center;margin-top:120px}}.nav-illustration{position:relative;color:#474b7e;background-color:#f8fafc}.nav-illustration .nav{position:relative;background:0 0}.nav-illustration .nav a{color:#474b7e}.nav-illustration .nav .nav__content .nav__btn{border:1px solid #474b7e}.nav-illustration .nav .nav__content .nav__content__left .nav__header .nav__menu-toggle .nav__menu-icon{fill:#474b7e}.nav-illustration .illustration{background-color:transparent}.image .image__content{text-align:center;padding-top:60px;padding-bottom:60px}.image .image__content img{max-width:100%;height:auto}.image-gallery .image-gallery__content{padding-top:60px;padding-bottom:60px}.image-gallery .image-gallery__content .images-list{margin:0}.image-gallery .image-gallery__content .images-list img{max-width:100%;height:auto}.image-text .image-text__content{display:flex;padding-top:60px;padding-bottom:60px}.image-text .image-text__content .img-part img{max-height:300px}.image-text .image-text__content .text-part{padding-left:30px;padding-right:30px}.image-text .image-text__content .text-part p{font-size:18px;line-height:1.8}@media screen and (max-width:568px){.image-text:not(.preview) .image-text__content{flex-direction:column}.image-text:not(.preview) .image-text__content .img-part img{max-width:100%;height:auto}.image-text:not(.preview) .image-text__content .text-part h2,.image-text:not(.preview) .image-text__content .text-part p{text-align:center}}.text-image .text-image__content{display:flex;padding-top:60px;padding-bottom:60px}.text-image .text-image__content .text-part{padding-left:30px;padding-right:30px}.text-image .text-image__content .text-part p{font-size:18px;line-height:1.8}.text-image .text-image__content .img-part img{max-height:300px}@media screen and (max-width:568px){.text-image:not(.preview) .text-image__content{flex-direction:column-reverse}.text-image:not(.preview) .text-image__content .text-part h2,.text-image:not(.preview) .text-image__content .text-part p{text-align:center}.text-image:not(.preview) .text-image__content .img-part img{max-width:100%;height:auto}}.paragraph .paragraph__content p{display:inline-block;padding:60px 30px;line-height:1.8;font-size:18px}.paragraph .paragraph__content p a{color:#556cd6;text-decoration:none}.download-cols{background:#fafafa}.download-cols .download-cols__content .download-options{padding-top:60px;padding-bottom:60px;justify-content:space-evenly}.download-cols .download-cols__content .download-options .device{display:flex;flex-direction:column;align-items:center;padding:50px;background:#fff;border-radius:6px;box-shadow:0 0 1px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.03);margin:15px}.download-cols .download-cols__content .download-options .device a{text-decoration:none}.download-cols .download-cols__content .download-options .device .device-icon{margin-bottom:15px}.download-cols .download-cols__content .download-options .device .device-icon img{width:72px}.download-cols .download-cols__content .download-options .device .device-name{font-size:28px}.download-cols .download-cols__content .download-options .device .device-version{line-height:2;white-space:nowrap;color:#929292;font-weight:lighter;font-size:13px;margin:0 0 20px}.download-cols .download-cols__content .download-options .device .whats-new{color:#33691e}.download-cols .download-cols__content .download-options .device .download-btn{display:flex;align-items:center;padding:15px 20px;color:#fff;font-weight:700;border:solid 1px #cc7832;border-radius:5px;background:#cc7832 no-repeat 1.35em .94em;line-height:1.2;text-shadow:none;font-size:16px;margin-top:10px}.download-cols .download-cols__content .download-options .device .download-btn img{width:18px;position:relative;margin-top:-3px;margin-right:5px}.download-cols .download-cols__content .download-options .device table{margin-top:20px;font-size:14px}.download-cols .download-cols__content .download-options .device table td{height:25px}.download-cols .download-cols__content .download-options .device table td:not(:last-child){padding-right:10px}.download-cols .download-cols__content .download-options .device table td a{color:#556cd6}@media screen and (max-width:768px){.download-cols:not(.preview) .download-cols__content .download-options .device{margin:15px}}@media screen and (max-width:568px){.download-cols:not(.preview) .download-cols__content .download-options .device{margin:15px 30px}}.downloading .downloading__content .container{color:#9a9a9a;padding:60px}.downloading .downloading__content .container .title{color:#313131;text-align:center;font-weight:100}.downloading .downloading__content .container .img-wrapper{text-align:center;margin:40px auto 40px}.downloading .downloading__content .container .img-wrapper img{width:100%;max-width:540px;max-height:310px}.downloading .downloading__content .container .d-link{color:#589df6;text-decoration:none}.downloading .downloading__content .container p{color:#333;font-size:18px;text-align:center;line-height:1.8}.ft-cols .ft-cols__content .ft-items{padding-top:60px;padding-bottom:60px;justify-content:space-evenly}.ft-cols .ft-cols__content .ft-items .ft-item{display:flex;flex-direction:column;align-items:center;padding:15px;margin:15px;text-align:center}.ft-cols .ft-cols__content .ft-items .ft-item a{text-decoration:none}.ft-cols .ft-cols__content .ft-items .ft-item .ft-icon img{width:72px}.ft-cols .ft-cols__content .ft-items .ft-item .ft-name{font-size:22px;margin-top:10px;margin-bottom:15px}.ft-cols .ft-cols__content .ft-items .ft-item .ft-desc{line-height:1.5;color:#555;font-weight:lighter;font-size:13px;margin:0 0 20px}@media screen and (max-width:768px){.ft-cols:not(.preview) .ft-cols__content .ft-items .ft-item{margin:15px}}@media screen and (max-width:568px){.ft-cols:not(.preview) .ft-cols__content .ft-items .ft-item{margin:15px 30px}}.pricing-cols{background:#fafafa}.pricing-cols .pricing-cols__content .plans{padding-top:60px;padding-bottom:60px;justify-content:space-evenly;font-size:14px}.pricing-cols .pricing-cols__content .plans .plan{display:flex;flex-direction:column;align-items:center;text-align:center;padding:50px 20px;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.03)}.pricing-cols .pricing-cols__content .plans .plan .plan-name{padding-bottom:8px;font-weight:600;font-size:20px}.pricing-cols .pricing-cols__content .plans .plan .plan-price{font-weight:700;font-size:40px;letter-spacing:.34px;line-height:72px;padding-top:10px}.pricing-cols .pricing-cols__content .plans .plan .plan-price .dollar-sign{font-weight:lighter;font-size:20px;font-style:italic;position:relative;top:-15px;opacity:.6}.pricing-cols .pricing-cols__content .plans .plan .price-desc1,.pricing-cols .pricing-cols__content .plans .plan .price-desc2{font-size:13px;opacity:.6;line-height:1.5}.pricing-cols .pricing-cols__content .plans .plan .features{margin-top:30px;margin-bottom:30px;min-width:200px}.pricing-cols .pricing-cols__content .plans .plan .features .feature{line-height:2}.pricing-cols .pricing-cols__content .plans .plan .features .feature.excluded{opacity:.2}.pricing-cols .pricing-cols__content .plans .plan hr{width:100px;border:0;height:1px;background-image:linear-gradient(to right,rgba(200,200,200,0),rgba(200,200,200,.75),rgba(200,200,200,0))}.pricing-cols .pricing-cols__content .plans .plan a{text-decoration:none}.pricing-cols .pricing-cols__content .plans .plan .action-btn{display:flex;align-items:center;padding:15px 20px;color:#fff;font-weight:700;border:solid 1px #cc7832;border-radius:5px;background:#cc7832 no-repeat 1.35em .94em;line-height:1.2;text-shadow:none;font-size:16px;margin-top:10px}.pricing-cols .pricing-cols__content .plans .plan .plan-desc{margin-top:20px;font-size:13px;opacity:.65;line-height:1.5;min-height:40px}.pricing-cols .pricing-cols__content .plans .plan.popular{margin-top:-10px;background-image:url(../images/most-popular.svg);background-position:top right;background-repeat:no-repeat;background-size:75%}.pricing-cols .pricing-cols__content .plans .plan.popular .plan-name{border-radius:20px;padding:5px 15px;margin-bottom:8px;background:#bd3d37;color:#fff}.team-cols .team-cols__content{text-align:center;padding-top:60px;padding-bottom:60px}.team-cols .team-cols__content .team-members .member img{width:160px;border-radius:80px;margin-left:30px;margin-right:30px}.team-cols .team-cols__content .team-members .member .member-title{font-weight:lighter}.team-cols .team-cols__content .team-members .member .member-bio{line-height:1.8;margin:0 30px;font-size:13px;color:#3c3f41}.team-cols .team-cols__content .team-members .member .member-bio a{color:#556cd6;text-decoration:none}@media screen and (max-width:568px){.team-cols:not(.preview) .team-cols__content .team-members .member:not(:first-child){margin-top:60px}}.ackm .ackm__content{display:flex;flex-direction:column;padding-top:60px;padding-bottom:60px}.ackm .ackm__content h2{margin-left:30px;margin-right:30px}.ackm .ackm__content p{font-weight:lighter;margin-left:30px;margin-right:30px;line-height:1.5}.ackm .ackm__content .ackm-list{margin:20px 30px}.ackm .ackm__content .ackm-list .col{min-width:200px;line-height:2.5}.nl-form .nl-form__content{display:flex;flex-direction:column;align-items:center;padding-top:60px;padding-bottom:60px}.nl-form .nl-form__content img{width:48px}.nl-form .nl-form__content p{text-align:center;margin-left:20px;margin-right:20px}.nl-form .nl-form__content .newsletter-form{display:flex;justify-content:center;width:100%}.nl-form .nl-form__content .newsletter-form .newsletter-form-group{display:flex;justify-content:center;width:100%}.nl-form .nl-form__content .newsletter-form .newsletter-form-group .subscribe-email{font-size:18px;width:100%;max-width:320px;height:50px;text-decoration:none;padding-left:10px;padding-right:10px;border:none;box-sizing:border-box;border-top-left-radius:5px;border-bottom-left-radius:5px;background:#eee;outline:0}.nl-form .nl-form__content .newsletter-form .newsletter-form-group .subscribe-btn{font-size:18px;font-weight:700;text-decoration:none;text-transform:uppercase;padding-left:30px;padding-right:30px;height:50px;border-top-right-radius:5px;border-bottom-right-radius:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.1);fill:#fff;background:linear-gradient(#99bf38,#83a333);box-shadow:none;outline:0;border:0;-webkit-appearance:none}@media screen and (max-width:568px){.nl-form:not(.preview) .nl-form__content .newsletter-form .newsletter-form-group{flex-direction:column;padding-left:20px;padding-right:20px}.nl-form:not(.preview) .nl-form__content .newsletter-form .newsletter-form-group .subscribe-email{max-width:none;text-align:center;border-radius:5px 5px 0 0}.nl-form:not(.preview) .nl-form__content .newsletter-form .newsletter-form-group .subscribe-btn{border-radius:0 0 5px 5px}}.about-me{background:#4a4a4a;padding-top:30px;padding-bottom:30px}.about-me .about-me__content .box{margin-left:auto;margin-right:auto;display:flex;flex-direction:column;align-items:center;margin-top:80px;background:#fff;width:fit-content;border-radius:5px;padding-bottom:30px}.about-me .about-me__content .box .photo{margin-top:-80px}.about-me .about-me__content .box .photo img{width:160px;border-radius:50%;border:6px solid #eee;background:#fff}.about-me .about-me__content .box .name{margin-block-start:10px;margin-block-end:10px}.about-me .about-me__content .box .title{margin-block-start:0;margin-block-end:10px}.about-me .about-me__content .box .social-links{margin-top:15px}.about-me .about-me__content .box .social-links a{margin-right:10px;text-decoration:none}.about-me .about-me__content .box .social-links a img{width:24px}.about-me .about-me__content .box .bio{line-height:1.8;font-size:14px;color:#3c3f41;margin:10px 30px;max-width:488px}@media screen and (max-width:568px){.about-me:not(.preview) .about-me__content .box{margin-left:10px;margin-right:10px}}.roadmap{background-color:#f0f0f0;padding-top:80px}.roadmap .roadmap__content .milestones .milestone{position:relative;display:flex;flex-direction:column;align-items:center;padding-bottom:60px;border-top:1px solid #c3c3c3;font-size:14px}.roadmap .roadmap__content .milestones .milestone.done{color:#999}.roadmap .roadmap__content .milestones .milestone .arrow{position:absolute;left:-10px;top:-12px}.roadmap .roadmap__content .milestones .milestone .arrow svg{width:24px;height:23px;fill:#c3c3c3}.roadmap .roadmap__content .milestones .milestone .milestone-icon{width:32px;height:32px;border-radius:50%;box-shadow:0 0 1px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.03);position:relative;top:-16px;background-color:#fff;display:flex;align-items:center;justify-content:center}.roadmap .roadmap__content .milestones .milestone .milestone-icon svg{fill:#d2d2d2;width:16px}.roadmap .roadmap__content .milestones .milestone .milestone-card{margin:20px 30px 30px;padding:20px;background:#fff;border-radius:6px;box-shadow:0 0 1px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.03)}.roadmap .roadmap__content .milestones .milestone .milestone-card .milestone-name{font-weight:700;margin:0}.roadmap .roadmap__content .milestones .milestone .milestone-card .milestone-desc{line-height:1.5;margin-bottom:0;margin-block-end:14px;margin-block-start:14px}.roadmap .roadmap__content .milestones .milestone .milestone-card .milestone-desc ul{margin-left:-20px}.roadmap .roadmap__content .milestones .milestone .milestone-card .milestone-desc ul li{line-height:1.5}.roadmap .roadmap__content .milestones .milestone .milestone-card{position:relative;background:#fff;border:1px solid #fff}.roadmap .roadmap__content .milestones .milestone .milestone-card:after,.roadmap .roadmap__content .milestones .milestone .milestone-card:before{bottom:100%;left:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.roadmap .roadmap__content .milestones .milestone .milestone-card:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:12px;margin-left:-12px}.roadmap .roadmap__content .milestones .milestone .milestone-card:before{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:13px;margin-left:-13px}.custom-code .custom-code__content{display:flex;align-items:center;justify-content:center}.custom-code.design-mode{min-height:60px}.cbb{display:flex;align-items:center;height:38px;border-bottom:1px solid #dee5e8;background-color:#f6f7f8}.cbb .cbb__content{display:flex;justify-content:space-between;padding:0 30px;font-size:13px}.cbb .cbb__content .left-part{display:flex;align-items:center}.cbb .cbb__content .left-part .breadcrumb-item{color:#7d7d8e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:500px;height:15px}.cbb .cbb__content .left-part .breadcrumb-item a{color:#7d7d8e;text-decoration:none}.cbb .cbb__content .left-part .breadcrumb-item a:hover{text-decoration:underline}.cbb .cbb__content .left-part .breadcrumb-item .icon-arrow{height:10px;margin-left:5px;margin-right:10px}.cbb .cbb__content .right-part{display:flex;align-items:center;justify-content:space-between}.cbb .cbb__content .right-part .search-field{display:flex;align-items:center}.cbb .cbb__content .right-part .icon-search{height:13px;margin-right:5px}.cbb .cbb__content .right-part .search-box{border:0 none;background:#f6f7f8;height:30px;font-size:13px;box-shadow:none}.cbb .cbb__content .right-part .search-box:focus{outline:0}.cbb .cbb__content .right-part .search-box::placeholder{color:#ccc;opacity:1}.cbb .cbb__content .right-part .search-box:-ms-input-placeholder{color:#ccc}.cbb .cbb__content .right-part .search-box::-ms-input-placeholder{color:#ccc}.cbb .cbb__content .right-part #back-to-top{cursor:pointer;display:none;height:15px}@media screen and (max-width:1024px){.cbb:not(.preview) .cbb__content{padding:0 20px}}@media screen and (max-width:768px){.cbb:not(.preview) .cbb__content{padding:0 15px}.cbb:not(.preview) .cbb__content .left-part{display:none}.cbb:not(.preview) .cbb__content .right-part{width:100%}.cbb:not(.preview) .cbb__content .right-part .search-field{width:100%}.cbb:not(.preview) .cbb__content .right-part .search-field .search-box{width:100%}}.c-title .c-title__content{padding-bottom:40px}.c-title .c-title__content h1{display:flex;align-items:center;justify-content:center;text-align:center;margin:0;padding:80px 30px 20px;border-bottom:1px solid #eee}.c-title .c-title__content h1 .icon-draft{margin-left:5px;height:24px}.c-title .c-title__content .meta{text-align:center;margin-top:20px;margin-bottom:30px;display:flex;justify-content:center;align-items:center}.c-title .c-title__content .meta .avatar{width:48px;height:48px;border-radius:30px}.c-title .c-title__content .meta .author{color:#7d7d8e;margin-left:15px}.c-title .c-title__content .meta .meta-divider{font-size:28px;color:#cc7832;margin-left:10px;margin-right:10px}.c-title .c-title__content .meta .updated{color:#7d7d8e}.c-title .c-title__content .cover{background-image:url(../images/cover-blog.jpg);background-position:center;background-size:contain;background-repeat:no-repeat;background-color:transparent}.c-title .c-title__content .cover-desc{text-align:center;margin-top:10px;font-style:italic}.c-title .c-title__content .cover-desc a{color:#5ba13f;text-decoration:none;font-size:14px}@media screen and (max-width:768px){.c-article:not(.preview) .c-article__content .article-body{padding-left:30px;padding-right:30px}}@media screen and (max-width:568px){.c-article:not(.preview) .c-article__content .article-body{padding-left:20px;padding-right:20px}}.tc-article{background-color:#f3f5f7;padding:30px}.tc-article .tc-article__content{background-color:#fff;border:1px solid transparent;border-radius:4px;padding:60px;box-sizing:border-box;text-decoration:none;overflow:hidden;width:100%;display:block;outline:0;-webkit-box-shadow:0 3px 8px 0 rgba(0,0,0,.03);box-shadow:0 3px 8px 0 rgba(0,0,0,.03);-webkit-transition:border .15s linear,background-color .15s linear,opacity .15s linear,-webkit-transform .15s linear,-webkit-box-shadow .15s linear;transition:border .15s linear,background-color .15s linear,opacity .15s linear,-webkit-transform .15s linear,-webkit-box-shadow .15s linear;-o-transition:border .15s linear,transform .15s linear,background-color .15s linear,box-shadow .15s linear,opacity .15s linear;transition:border .15s linear,transform .15s linear,background-color .15s linear,box-shadow .15s linear,opacity .15s linear;transition:border .15s linear,transform .15s linear,background-color .15s linear,box-shadow .15s linear,opacity .15s linear,-webkit-transform .15s linear,-webkit-box-shadow .15s linear}.tc-article .tc-article__content .article-title h1{margin:0;padding:20px 0 0}.tc-article .tc-article__content .article-title h1 .icon-draft{margin-left:5px;height:24px}.tc-article .tc-article__content .article-title .meta{text-align:center;margin-top:20px;margin-bottom:30px;display:flex;justify-content:left;align-items:center}.tc-article .tc-article__content .article-title .meta .avatar{width:48px;height:48px;border-radius:30px}.tc-article .tc-article__content .article-title .meta .author{color:#7d7d8e;margin-left:15px}.tc-article .tc-article__content .article-title .meta .meta-divider{font-size:28px;color:#cc7832;margin-left:10px;margin-right:10px}.tc-article .tc-article__content .article-title .meta .updated{color:#7d7d8e}.tc-article .tc-article__content .article-body{padding-bottom:0}@media screen and (max-width:768px){.tc-article:not(.preview){padding:30px}.tc-article:not(.preview) .tc-article__content{padding:30px}}@media screen and (max-width:568px){.tc-article:not(.preview){padding:20px}.tc-article:not(.preview) .tc-article__content{padding:20px}}.c-nav-article-toc .c-nav-article-toc__content .icon-down{width:9px;margin-right:5px}.c-nav-article-toc .c-nav-article-toc__content .icon-draft{margin-left:5px;height:12px}.c-nav-article-toc .c-nav-article-toc__content #side-bar{padding-top:20px;padding-left:0;font-size:13px;box-shadow:1px 0 0 rgba(81,88,90,.17)}.c-nav-article-toc .c-nav-article-toc__content #side-bar h3{padding:0;margin-top:10px;margin-bottom:0;font-size:12px;text-transform:uppercase;color:#bbb;font-weight:600;letter-spacing:.5px;display:flex;align-items:center}.c-nav-article-toc .c-nav-article-toc__content #side-bar ul{margin:0 0 0 15px;list-style:none;padding-inline-start:15px}.c-nav-article-toc .c-nav-article-toc__content #side-bar ul li.folder-item{margin-left:-14px}.c-nav-article-toc .c-nav-article-toc__content #side-bar ul i{margin-right:5px}.c-nav-article-toc .c-nav-article-toc__content #side-bar ul a{display:flex;align-items:center;text-decoration:none;padding:3px 9px;color:#4c555a;cursor:pointer;line-height:1.8}.c-nav-article-toc .c-nav-article-toc__content #side-bar ul a:hover{background:#f0f0f0}.c-nav-article-toc .c-nav-article-toc__content #side-bar ul a.active{background-color:#e7f5ff;color:#000;display:block;border-left:3px solid #1c84cc;padding-left:6px}.c-nav-article-toc .c-nav-article-toc__content #side-bar>ul,.c-nav-article-toc .c-nav-article-toc__content #side-bar>ul>li>ul{padding-left:0;margin-left:0}.c-nav-article-toc .c-nav-article-toc__content #side-bar>ul{margin-left:0;margin-bottom:40px}.c-nav-article-toc .c-nav-article-toc__content #doc-content{padding-left:40px;padding-right:40px;padding-bottom:60px;min-height:720px;font-size:15px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-title{position:relative;border-bottom:1px solid #eee;margin-bottom:30px;margin-top:60px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-title h1{display:flex;align-items:center;font-weight:400;color:#33383c;font-size:30px;word-wrap:break-word}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-title h1 .icon-draft{height:24px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h1,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h2,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h3,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h4,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h5,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h6{font-weight:500;margin-top:40px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h1{color:#444;margin-top:40px;font-size:30px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h1:first-child{margin-top:0}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h2{margin-top:34px;font-size:25px;color:#555}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body h3{color:#666;font-size:20px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body figure{margin:0}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body img{max-width:100%}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body a{color:#5ba13f;text-decoration:none}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body p{line-height:2;margin:0 0 25px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body blockquote{background-color:#f1f8e9;border-left:4px solid #9ccc65;padding:16px;margin:30px 0}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body code,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body pre{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:14px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body pre{display:block;margin:0 0 10px;white-space:pre-wrap;word-break:break-all;word-wrap:break-word;line-height:1.6;overflow:auto!important;padding:16px;background:#f1f8e9;-webkit-box-shadow:0 0 10px #f1f8e9;box-shadow:0 0 10px #f1f8e9}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body ul li{line-height:2}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body li>code,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body p>code{padding:.2em .5em;margin:0;font-size:14px;background-color:#f1f8e9;color:#333;white-space:normal}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body li.task-item{list-style:none;margin-left:-20px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body li.task-item input[type=checkbox]{margin-right:5px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body table{border-collapse:collapse;margin-bottom:30px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body table td,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body table th{border:1px solid #dfe2e5;padding:10px 20px}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body table.two-col-text{border:none}.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body table.two-col-text td,.c-nav-article-toc .c-nav-article-toc__content #doc-content .doc-body table.two-col-text th{border:none;vertical-align:top;padding:0}.c-nav-article-toc .c-nav-article-toc__content #toc{margin:0;padding:40px 0 0 0}.c-nav-article-toc .c-nav-article-toc__content #toc img{height:12px;margin-left:-8px;margin-right:3px}.c-nav-article-toc .c-nav-article-toc__content #toc h3{margin-top:0;padding:0 5px;margin-bottom:10px;color:#7d7f7f;text-transform:uppercase;font-size:12px;letter-spacing:.5px;font-weight:700}.c-nav-article-toc .c-nav-article-toc__content #toc ul{margin:0 0 10px;padding:0 0 0 10px;list-style:none}.c-nav-article-toc .c-nav-article-toc__content #toc ul a{color:#898989;font-size:13px;text-decoration:none;padding:4px 5px 4px 5px;display:block;cursor:pointer;line-height:1.5;margin-bottom:2px}.c-nav-article-toc .c-nav-article-toc__content #toc ul a:hover{background:#f0f0f0}.c-nav-article-toc .c-nav-article-toc__content #toc ul a.active{background-color:#1c84cc;color:#fff;display:block}.c-nav-article-toc .c-nav-article-toc__content #toc>ul{padding:0}@media screen and (max-width:1024px){.c-nav-article-toc:not(.preview) .c-nav-article-toc__content #side-bar{padding-left:20px}.c-nav-article-toc:not(.preview) .c-nav-article-toc__content #toc{display:none}}@media screen and (max-width:768px){.c-nav-article-toc:not(.preview) .c-nav-article-toc__content #side-bar{padding-left:15px}.c-nav-article-toc:not(.preview) .c-nav-article-toc__content #doc-content{padding-left:15px;padding-right:15px}}.d-2c-cards{background:initial}.d-2c-cards .d-2c-cards__content .cards-view .post-list{padding-top:30px}@media screen and (max-width:568px){.d-2c-cards:not(.preview) .d-2c-cards__content #doc-content .post-list{padding-top:0}.d-2c-cards:not(.preview) .d-2c-cards__content #doc-content .post-list .col{padding-left:0;padding-right:0}}.d-2c-list{background:initial}.d-2c-list .d-2c-list__content .list-view .post-list{padding-top:30px}@media screen and (max-width:768px){.d-2c-list:not(.preview) .d-2c-list__content .post-card{flex-direction:column}.d-2c-list:not(.preview) .d-2c-list__content .post-card .thumbnail a{padding:0;margin:0}.d-2c-list:not(.preview) .d-2c-list__content .post-card .thumbnail a img{width:100%;border-top-left-radius:8px;border-top-right-radius:8px}}@media screen and (max-width:568px){.d-2c-list:not(.preview) .d-2c-list__content #doc-content .post-list{padding-top:0}.d-2c-list:not(.preview) .d-2c-list__content #doc-content .post-list .col{padding-left:0;padding-right:0}}.d-toc-tree{background:#fff}.d-toc-tree .d-toc-tree__content .icon-down{width:9px;margin-right:5px}.d-toc-tree .d-toc-tree__content .icon-draft{margin-left:5px;height:12px}.d-toc-tree .d-toc-tree__content h1{text-align:center;margin:0;padding:80px 30px 20px;border-bottom:1px solid #eee}.d-toc-tree .d-toc-tree__content h1 .icon-draft{height:24px}.d-toc-tree .d-toc-tree__content .toc{padding:30px 10px 60px;font-size:14px}.d-toc-tree .d-toc-tree__content .toc h3{padding:0;margin:0;color:#555;font-weight:600;letter-spacing:.5px;display:flex;align-items:center}.d-toc-tree .d-toc-tree__content .toc ul{margin:0 0 0 15px;list-style:none;padding-inline-start:15px}.d-toc-tree .d-toc-tree__content .toc ul li .line{display:flex;justify-content:space-between;align-items:center;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3ctitle%3edot%3c/title%3e%3ccircle cx='4' cy='4' r='1' style='fill:%23999'/%3e%3c/svg%3e");background-repeat:repeat-x;background-size:8px 8px;background-position-y:center;background-clip:content-box}.d-toc-tree .d-toc-tree__content .toc ul li .line .head,.d-toc-tree .d-toc-tree__content .toc ul li .line .tail{background:#fff}.d-toc-tree .d-toc-tree__content .toc ul li .line .head{display:flex;align-items:center;padding-right:5px;color:#556cd6;font-weight:700}.d-toc-tree .d-toc-tree__content .toc ul li .line .tail{padding-left:5px}.d-toc-tree .d-toc-tree__content .toc ul li.folder-item{margin-left:-14px}.d-toc-tree .d-toc-tree__content .toc ul i{margin-right:5px}.d-toc-tree .d-toc-tree__content .toc ul a{display:flex;align-items:center;text-decoration:none;border-radius:3px;padding:3px 9px;color:#4c555a;cursor:pointer;line-height:1.8}.d-toc-tree .d-toc-tree__content .toc ul a:hover{background-color:#f0f0f0}.d-toc-tree .d-toc-tree__content .toc ul a:hover .head,.d-toc-tree .d-toc-tree__content .toc ul a:hover .tail{background-color:#f0f0f0}.d-toc-tree .d-toc-tree__content .toc>ul{padding-inline-start:0;margin-inline-start:0}.l-cards{background:#f1f1f1}.l-list{background:#f1f1f1}@media screen and (max-width:568px){.l-list:not(.preview) .l-list__content .post-card{flex-direction:column}.l-list:not(.preview) .l-list__content .post-card .thumbnail a{padding:0;margin:0}.l-list:not(.preview) .l-list__content .post-card .thumbnail a img{width:100%;border-top-left-radius:8px;border-top-right-radius:8px}}.footer-cols{background:#313131;border-top:1px solid #4d4d4d}.footer-cols .footer-cols__content{padding:30px 0}.footer-cols .footer-cols__content ul{list-style:none;padding:0 20px 0 0}.footer-cols .footer-cols__content ul li{margin-bottom:10px}.footer-cols .footer-cols__content ul li a{color:#a9a9a9;font-size:13px;text-decoration:none}.footer-cols .footer-cols__content ul li a:hover{text-decoration:underline}.footer-cols .footer-cols__content ul li .external-link img{width:9px;margin-left:5px;position:relative;top:-3px}.footer-cols .footer-cols__content ul li .title{text-transform:uppercase;color:#c8c8c8;font-size:13px;font-weight:700}@media screen and (max-width:768px){.footer-cols:not(.preview) .footer-cols__content{padding:30px 0 30px 20px}}.footer-info{background:#313131;border-top:1px solid #4d4d4d}.footer-info .footer-info__content{display:flex;padding:30px 0;justify-content:space-between;color:#a9a9a9}.footer-info .footer-info__content .left-section .logo{display:flex;align-items:center}.footer-info .footer-info__content .left-section .logo img{width:24px;margin-right:5px}.footer-info .footer-info__content .left-section .logo h3{color:#c8c8c8;font-size:14px;margin-top:5px;margin-bottom:5px}.footer-info .footer-info__content .left-section .slogan{font-size:13px;margin-top:5px;line-height:1.4}.footer-info .footer-info__content .left-section .language{display:flex;align-items:center;margin-top:15px;margin-bottom:15px}.footer-info .footer-info__content .left-section .language img{width:13px}.footer-info .footer-info__content .left-section .language .language-selector{color:#c8c8c8;font-size:12px;margin-left:5px;cursor:pointer}.footer-info .footer-info__content .left-section .address{font-size:12px;margin:0;line-height:1.6}.footer-info .footer-info__content .right-section{text-align:right;display:flex;flex-direction:column;justify-content:space-between}.footer-info .footer-info__content .right-section ul{list-style:none;display:inline;padding:0;margin-top:0}.footer-info .footer-info__content .right-section ul li{display:inline}.footer-info .footer-info__content .right-section ul li a{color:#a9a9a9;font-size:13px;text-decoration:none}.footer-info .footer-info__content .right-section ul li a:hover{text-decoration:underline}.footer-info .footer-info__content .right-section ul li:not(:last-child){margin-right:15px}.footer-info .footer-info__content .right-section .social-links{margin-top:15px}.footer-info .footer-info__content .right-section .social-links a{margin-right:10px;text-decoration:none}.footer-info .footer-info__content .right-section .social-links a img{width:16px}.footer-info .footer-info__content .right-section .copyright{font-size:12px;margin-bottom:0}@media screen and (max-width:768px){.footer-info:not(.preview) .footer-info__content{flex-direction:column}.footer-info:not(.preview) .footer-info__content .left-section{padding-left:20px;padding-right:20px}.footer-info:not(.preview) .footer-info__content .right-section{padding-top:30px;padding-left:20px;padding-right:20px;text-align:left}.footer-info:not(.preview) .footer-info__content .right-section ul li{display:list-item;line-height:1.5}}.footer-info-spl{background:#313131}.footer-info-spl .footer-info-spl__content{padding:30px 0;color:#a9a9a9}.footer-info-spl .footer-info-spl__content .row-1{display:flex;align-items:center;justify-content:space-between}.footer-info-spl .footer-info-spl__content .row-1 .logo{display:flex;align-items:center}.footer-info-spl .footer-info-spl__content .row-1 .logo img{width:24px;margin-right:5px}.footer-info-spl .footer-info-spl__content .row-1 .logo h3{color:#c8c8c8;font-size:14px;margin-top:5px;margin-bottom:5px}.footer-info-spl .footer-info-spl__content .row-1 .social-links a{margin-right:10px;text-decoration:none}.footer-info-spl .footer-info-spl__content .row-1 .social-links a img{width:16px}.footer-info-spl .footer-info-spl__content .row-2{display:flex;align-items:center;justify-content:space-between}.footer-info-spl .footer-info-spl__content .row-2 .copyright{font-size:12px}.footer-info-spl .footer-info-spl__content .row-2 ul{list-style:none;display:inline;padding:0}.footer-info-spl .footer-info-spl__content .row-2 ul li{display:inline}.footer-info-spl .footer-info-spl__content .row-2 ul li a{color:#a9a9a9;font-size:13px;text-decoration:none}.footer-info-spl .footer-info-spl__content .row-2 ul li a:hover{text-decoration:underline}.footer-info-spl .footer-info-spl__content .row-2 ul li:not(:last-child){margin-right:15px}@media screen and (max-width:768px){.footer-info-spl:not(.preview) .footer-info-spl__content .row-1,.footer-info-spl:not(.preview) .footer-info-spl__content .row-2{padding-left:20px;padding-right:20px}}@media screen and (max-width:568px){.footer-info-spl:not(.preview) .footer-info-spl__content .row-1{flex-direction:column;align-items:normal}.footer-info-spl:not(.preview) .footer-info-spl__content .row-1 .social-links{margin-top:15px}.footer-info-spl:not(.preview) .footer-info-spl__content .row-2{flex-direction:column-reverse;align-items:normal}.footer-info-spl:not(.preview) .footer-info-spl__content .row-2 ul li{display:list-item;line-height:1.5}}.footer-info-cols{background:#313131;border-top:1px solid #4d4d4d}.footer-info-cols .footer-info-cols__content{padding:30px 0;color:#a9a9a9}.footer-info-cols .footer-info-cols__content .info-section{padding:0 60px 0 0}.footer-info-cols .footer-info-cols__content .info-section .logo{display:flex;align-items:center}.footer-info-cols .footer-info-cols__content .info-section .logo img{width:24px;margin-right:5px}.footer-info-cols .footer-info-cols__content .info-section .logo h3{color:#c8c8c8;font-size:14px;margin-top:5px;margin-bottom:5px}.footer-info-cols .footer-info-cols__content .info-section .slogan{font-size:13px;margin-top:5px;line-height:1.4}.footer-info-cols .footer-info-cols__content .info-section .language{display:flex;align-items:center;margin-top:15px;margin-bottom:15px}.footer-info-cols .footer-info-cols__content .info-section .language img{width:13px}.footer-info-cols .footer-info-cols__content .info-section .language .language-selector{color:#c8c8c8;font-size:12px;margin-left:5px;cursor:pointer}.footer-info-cols .footer-info-cols__content .info-section .address{font-size:12px;margin:0;line-height:1.6}.footer-info-cols .footer-info-cols__content .info-section .social-links{margin-top:15px}.footer-info-cols .footer-info-cols__content .info-section .social-links a{margin-right:10px;text-decoration:none}.footer-info-cols .footer-info-cols__content .info-section .social-links a img{width:16px}.footer-info-cols .footer-info-cols__content .info-section .copyright{font-size:12px;margin-bottom:0}.footer-info-cols .footer-info-cols__content .links-section ul{list-style:none;padding:0;margin:0 0 30px}.footer-info-cols .footer-info-cols__content .links-section ul li{margin-bottom:10px}.footer-info-cols .footer-info-cols__content .links-section ul li a{color:#a9a9a9;font-size:13px;text-decoration:none}.footer-info-cols .footer-info-cols__content .links-section ul li a:hover{text-decoration:underline}.footer-info-cols .footer-info-cols__content .links-section ul li .external-link img{width:9px;margin-left:5px;position:relative;top:-3px}.footer-info-cols .footer-info-cols__content .links-section ul li .title{text-transform:uppercase;color:#c8c8c8;font-size:13px;font-weight:700}@media screen and (max-width:768px){.footer-info-cols:not(.preview) .footer-info-cols__content{padding:30px 0}.footer-info-cols:not(.preview) .footer-info-cols__content .info-section{padding-left:20px;padding-right:0}}@media screen and (max-width:568px){.footer-info-cols:not(.preview) .footer-info-cols__content{flex-direction:column-reverse}.footer-info-cols:not(.preview) .footer-info-cols__content .links-section{margin-left:0;margin-top:0;padding-left:20px}}.footer-powered-by{background:#313131}.footer-powered-by .footer-powered-by__content{display:flex;justify-content:center}.footer-powered-by .footer-powered-by__content .poweredby{margin:30px;display:flex;align-items:center}.footer-powered-by .footer-powered-by__content .poweredby span{font-size:13px;color:#a9a9a9}.footer-powered-by .footer-powered-by__content .poweredby a{color:#c8c8c8;text-decoration:none;display:inline-flex;align-items:center}.footer-powered-by .footer-powered-by__content .poweredby a img{height:24px;margin-left:5px;margin-right:3px}.footer-powered-by .footer-powered-by__content .poweredby b{font-size:14px;font-weight:600} \ No newline at end of file diff --git a/tutorial.html b/tutorial.html deleted file mode 100644 index a50b684..0000000 --- a/tutorial.html +++ /dev/null @@ -1,938 +0,0 @@ - - - - - - Tutorials - - - -
    -
    -
    -

    Use Case Tutorials

    -

    The following are a collection of potential use cases for the CoinPayments API with example steps for integration.

    -

    Prerequisites for tutorials

    -
      -
    • A CoinPayments.net account.
    • -
    • A platform capable of making HTTP calls to the CoinPayments.net API.
    • -
    • Developer understanding of the introduction documentation section for the CoinPayments.net API.
    • -
    • A private and public API key (from this logged in account page).
    • -
    • Knowledge of the different coin codes, listed in the CODE column on the supported coins page. These codes (also known as tickers) are used in the API calls anytime a "currency", "to" or "from" field is needed.
    • -
    -

    Note: These tutorials assume every HTTP request executing on https://alpha.coinpayments.net/ and he will be skipped in examples. Also, assume so every API response format to be the default format of JSON.

    -

    Tutorial 1: E-Commerce System Checkout

    -

    This tutorial will cover integrating the following features using the CoinPayments.net API:

    -
      -
    • Get a list of available currencies
    • -
    • Returns the currency conversion rates for the specified from currencies converted to the specified to currencies
    • -
    • Be notified of a completed payment by the IPN system.
    • -
    -

    Part A: Get a list of available currencies

    -

    For getting all available currencies we'll send an HTTP request (GET) to /api/v1/currencies.
    - The response will contain information about all available currencies.
    - Currency information looks like

    -
    {
    -     "id":1,
    -     "type":"crypto",
    -     "symbol":"BTC",
    -     "name":"Bitcoin",
    -     "logo":{
    -        "imageUrl":"https://api.coinpayments.net/static/img/coins/64x64/1.png",
    -        "vectorUrl":"https://api.coinpayments.net/static/img/coins/vector/1.svg"
    -     },
    -     "decimalPlaces":8,
    -     "rank":1,
    -     "status":"active",
    -     "capabilities":[
    -        "multiSigAccounts",
    -        "singleSigAccounts"
    -     ],
    -     "urls":{
    -        "websites":[
    -           "https://bitcoin.org"
    -        ],
    -        "explorers":[
    -           "https://blockchain.info"
    -        ]
    -     }
    -  }
    -  
    -

    Part B: The currency conversion rates

    -

    For check rate between currencies, we'll send the HTTP request (GET) to /api/v1/rates?from=1&to=5057
    - query param explanation:

    - - - - - - - - - - - - - - - - - -
    ParameterDescription
    fromcurrency id to use as the source for rate calculations
    tocomma separated list of currency ids for which to retrieve conversion rates for (from the from currencies)
    -

    The response will be looks like

    -
    {
    -    "items": [
    -      {
    -        "baseCurrencyId": 1,
    -        "quoteCurrencyId": 5057,
    -        "rate": "8896.619359154478102279714028"
    -      }
    -    ]
    -  }
    -  
    -

    Part C: Checkout

    -

    The next example explains how to create a payment using the CoinPayments.net API in order to accept payment in your e-commerce system during the checkout process. You will need to know the following information in order to create the payment:

    -
      -
    • The total price that you wish to charge for the payment.
    • -
    • Buyer personal data (name, email, phone, etc)
    • -
    -

    For creating new payment we will send HTTP request (POST) to /api/v1/invoices. The request body should look like

    -
    {
    -    "clientId": "string",
    -    "currencyId": 0,
    -    "invoiceId": "string",
    -    "buyer": {
    -      "companyName": "string",
    -      "name": {
    -        "firstName": "string",
    -        "lastName": "string"
    -      },
    -      "emailAddress": "user@example.com",
    -      "phoneNumber": "string",
    -      "address": {
    -        "address1": "string",
    -        "address2": "string",
    -        "address3": "string",
    -        "provinceOrState": "string",
    -        "city": "string",
    -        "suburbOrDistrict": "string",
    -        "countryCode": "string",
    -        "postalCode": "string"
    -      }
    -    },
    -    "description": "string",
    -    "items": [
    -      {
    -        "customId": "string",
    -        "sku": "string",
    -        "name": "string",
    -        "description": "string",
    -        "quantity": 0,
    -        "originalAmount": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "amount": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "tax": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        }
    -      }
    -    ],
    -    "amount": {
    -      "breakdown": {
    -        "subtotal": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "shipping": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "handling": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "taxTotal": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        },
    -        "discount": {
    -          "currencyId": 0,
    -          "displayValue": "string",
    -          "value": "string"
    -        }
    -      },
    -      "currencyId": 0,
    -      "displayValue": "string",
    -      "value": "string"
    -    },
    -    "shipping": {
    -      "method": "string",
    -      "companyName": "string",
    -      "name": {
    -        "firstName": "string",
    -        "lastName": "string"
    -      },
    -      "emailAddress": "user@example.com",
    -      "phoneNumber": "string",
    -      "address": {
    -        "address1": "string",
    -        "address2": "string",
    -        "address3": "string",
    -        "provinceOrState": "string",
    -        "city": "string",
    -        "suburbOrDistrict": "string",
    -        "countryCode": "string",
    -        "postalCode": "string"
    -      }
    -    },
    -    "requireBuyerNameAndEmail": true,
    -    "buyerDataCollectionMessage": "string",
    -    "notesToRecipient": "string",
    -    "termsAndConditions": "string",
    -    "customData": {
    -      "additionalProp1": "string",
    -      "additionalProp2": "string",
    -      "additionalProp3": "string"
    -    },
    -    "metadata": {
    -      "integration": "string",
    -      "hostname": "string"
    -    }
    -  }
    -  
    -
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    clientIdThe id of the client creating this invoiceYes
    currencyIdThe id of the currency the invoice is to be in, alternatively this can be set individually per fieldNo
    invoiceIdThe optional API caller provided external invoice number. Appears in screens shown to the Buyer and emails sent.No
    buyerInfo about buyerNo
    descriptionThe purchase description, can be provided instead of a list of itemsNo
    itemsThe optional array of items that a buyer intends to purchase from the merchantNo
    amountThe total amount of the invoice, with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance and discounts, if anyYes
    shippingThe optional shipping method and addressNo
    requireBuyerNameAndEmailFlag indicating whether a buyer name and email are required, they will be requested at checkout if not provider by the callerNo
    buyerDataCollectionMessageThe message to display when collecting buyer user dataNo
    notesToRecipientAny additional information to share with the buyer about the transactionNo
    termsAndConditionsAny terms and conditions, e.g. a cancellation policyNo
    customDataAny custom data the caller wishes to attach to the invoice which will be sent back in notificationsNo
    metadataNo
    -

    Tutorial 2: User Currency Withdrawal

    -

    This tutorial will cover integrating the following features using the CoinPayments.net API.

    -
      -
    • Having a user withdraw an amount of currency from your CoinPayments.net account to a specified currency address (outside the CoinPayments.net system).
    • -
    • The withdrawing system checking it's currency balance before initiating the withdrawal.
    • -
    -

    Some example scenarios that this tutorial would apply to include:

    -
      -
    • A gambling platform where the user wishes to cash out some of their account's holdings.
    • -
    • A freelancer network where a job has been completed and the service provider needs to be paid by the network's system (acting as escrow).
    • -
    • A company paying it's employees payroll from their CoinPayments.net wallet.
    • -
    -

    To create a transaction and spend funds from an account we will send HTTP request (POST) to
    - /api​/v1​/accounts​/{id}​/spend. The request body should look like

    -
      -
    • id - The id of the account from which to spend funds from
    • -
    -
    {
    -    "recipients": [
    -      {
    -        "address": "string",
    -        "amount": "string"
    -      }
    -    ],
    -    "memo": "string",
    -    "customData": {
    -      "additionalProp1": {},
    -      "additionalProp2": {},
    -      "additionalProp3": {}
    -    }
    -  }
    -  
    -
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    recipientsThe list of recipients to send funds toYes
    memoCustom memo to attach to this transaction, this will only be visible within CoinPayments®No
    customDataOptional additional information for the spend request e.g. "UseHopAddress" for EthereumNo
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -    "spendRequestId": "string",
    -    "spendRequestToken": "string"
    -  }
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - -
    ParameterDescription
    spendRequestIdThe id of the created request to spend funds
    spendRequestTokenAdditional validation token that must be sent up with the signed request
    -

    Tutorial 3: Convert Coins

    -

    This tutorial covers converting coins in your CoinPayments.net wallet from one currency to another using the API request /api/v1/accounts/{id}/convert. It also explains how to first check the conversion limits for a coin pairing and confirm that conversion for the given pair is supported. Even though a call to the request will throw an error if the coin pairing is not supported, it's good practice to check the amount you're planning to convert is within the minimum and maximum limits, with the additional benefit of finding out before making the convert request call if the pairing is supported or not.

    -

    For create a transaction and convert funds from an account we'll send HTTP request(POST) to /api/v1/accounts/{id}/convert

    -
      -
    • id - The id of the account for converting
    • -
    -

    The request body should look like

    -
    {
    -    "convertToCurrency": 0,
    -    "recipients": [
    -      {
    -        "address": "string",
    -        "amount": "string"
    -      }
    -    ],
    -    "memo": "string",
    -    "customData": {
    -      "additionalProp1": {},
    -      "additionalProp2": {},
    -      "additionalProp3": {}
    -    }
    -  }
    -  
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    convertToCurrencyCurrency into which funds should be convertedYes
    recipientsYes
    memoCustom memo to attach to this transaction, this will only be visible within CoinPayments®No
    customDataOptional additional informationNo
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -    "spendRequestId": "string",
    -    "spendRequestToken": "string"
    -  }
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - -
    ParameterDescription
    spendRequestIdThe id of the created request to spend funds
    spendRequestTokenAdditional validation token that must be sent up with the signed request
    - - - - - -

    Tutorial 4: Using the MerchantCallback api endpoints

    -

    This tutorial covers creating callback addresses CoinPayments.net using the API request /api/v1/merchant/callbacks and receiving IPNDTO on your url. It also explains how to list all callback addresses, find the callback address by its id, update information about the callback address and list information about all merchant transactions.

    - For sending any of these requests you have to use a pre-request for the authentication. Here is an example in JavaScript: -
    -    
    -  var clientId = "7aa5e7ba45d84d978c5ea7f62498abf4";
    -  var clientKey = "I1sCXrA4jS29f4JYk3mohCoErLHvpESW3XF83sxo/lg=";
    -  pm.request.headers.add({
    -      key: "X-CoinPayments-Client",
    -      value: clientId
    -  });
    -  var date = new Date().toUTCString();
    -  pm.request.headers.add({
    -      key: "X-CoinPayments-Timestamp",
    -      value: date
    -  });
    -  var text = pm.request.method + pm.request.url + clientId + date + pm.request.body;
    -  var hash = CryptoJS.HmacSHA256("\ufeff" + text, clientKey);
    -  var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
    -  pm.request.headers.add({
    -      key: "X-CoinPayments-Signature",
    -      value: hashInBase64
    -  });
    -    
    -  
    - -

    Receiving IPNDTO

    - -

    - When merchant, for example, makes a transaction, the request is sent to the url specified for callback address. -
    To receive IPNDTO you should make 3 steps: -

      -
    1. Create callback address by using the request describing below, specify your callback url webhook.
    2. -
    3. Deposit some crypto at the callback address.
    4. -
    5. Receive a ipndto at your callback url webhook.
    6. -
    -

    - -

    Part A: Creating callback addresses

    -

    For creating callback addresses we'll send HTTP request(POST) to /api/v1/merchant/callbacks

    -

    The request body should look like

    -
    {
    -    "clientId":"7aa5e7ba45d84d978c5ea7f62498abf4",
    -    "currencyId":4,
    -    "label":"testcallbacketh",
    -    "webhook":{
    -        "nativeCurrencyId":1,
    -        "url":"https://google.com"
    -    }
    -}
    -
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    clientIdThe id of the currency the address will be receivingNo
    currencyIdThe id of the currency the address will be receivingYes
    labelThe label of the address (display only)No
    webhookThe webhook notification information and customizationsNo
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -     "id":"6Fa43sdVgjHuZRMuzei8ae",
    -     "clientId":"AaXX9g2Zp99ij2cvLVymTN",
    -     "created":"2020-10-28T09:44:54.9986654+00:00",
    -     "currencyId":4,
    -     "address":"0x4ca1a7a8332d4cad0abe4dbcb58c10d6edf4e315",
    -     "label":"testcallbacketh",
    -     "webhook":{
    -         "url":"https://google.com",
    -         "nativeCurrencyId":1
    -     }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescription
    idThe unique id of the callback address
    clientIdThe merchant client this callback address is linked to
    createdThe timestamp of when the callback address was created
    currencyIdThe id of the currency the address is receiving
    addressThe actual deposit address
    labelThe display label of the callback address
    webhookThe webhook notification information and customizations
    - -

    Part B: Sending a request to spend funds from the account

    -

    This part was described in the Tutorial 2.

    - - After making these steps the request will be sent on your url. -

    The body of the request contains next information:

    -
    {
    -  "id": "bdaae1f4c051445099325f384a74e46b",
    -  "type": "CallbackDepositConfirmed",
    -  "timestamp": "2020-10-15T13:16:56.27704444+00:00",
    -  "transaction": {
    -    "callbackAddressId": "Lhdrs8hw6z3WWpHD6oMBea",
    -    "address": "0x4723e2edcdedd471e016b03765df8f9c56572c69",
    -    "currency": {
    -      "id": "4",
    -      "symbol": "ETH",
    -      "name": "Ethereum",
    -    },
    -    "amount": {
    -      "currencyId": "0",
    -      "displayValue": "0.000000000000000001",
    -      "value": "1"
    -    },
    -    "coinPaymentsFee": {
    -      "currencyId": "0",
    -      "displayValue": "0.000000000000000000",
    -      "value": "0"
    -    },
    -    "nativeCurrency": {
    -      "id": "1",
    -      "symbol": "BTC",
    -      "name": "Bitcoin",
    -    },
    -    "nativeAmount": {
    -      "currencyId": "0",
    -      "displayValue": "0.00000000",
    -      "value": "0"
    -    },
    -    "nativeCoinPaymentsFee": {
    -      "currencyId": "0",
    -      "displayValue": "0.00000000",
    -      "value": "0"
    -    },
    -    "status": "Confirmed"
    -  }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescription
    idThe unique id of the ipn notification
    typeThe type of notification
    timestampThe timestamp of when the notification was generated
    invoiceThe invoice the notification was sent for
    payoutsThe payout information of the invoice, once available
    transactionCallback deposit transaction
    customdataAny custom data associated with the callback address, specified at the time when the callback address was created
    - - -

    Other requests which can be helpful for working with callbacks:

    -
    -

    List of all callback addresses

    -

    For list all callback addresses sorted descending by the creation date we'll send HTTP request(GET) to /api/v1/merchant/callbacks

    -
      -
    • clientId - The merchant client id whose callback address should be listed
    • -
    • currencyId - The id of the currency the address was receiving
    • -
    • after -
    • -
    • limit -
    • -
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -     "items":[{
    -         "id":"6Fa43sdVgjHuZRMuzei8ae",
    -          "clientId":"AaXX9g2Zp99ij2cvLVymTN",
    -          "created":"2020-10-28T09:44:54.998665+00:00",
    -          "currencyId":4,
    -          "address":"0x4ca1a7a8332d4cad0abe4dbcb58c10d6edf4e315",
    -          "label":"testcallbacketh",
    -          "webhook":{
    -              "url":"https://google.com",
    -              "nativeCurrencyId":1
    -          }
    -     }],
    -     "paging":{
    -          "cursors":{
    -              "before":"WpESICZ72Ag=",
    -              "after":"At0ZPLdf2Ag="
    -          },
    -          "limit":100
    -     }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - -
    ParameterDescription
    itemsInformation about the callback address
    paging
    - -

    Searching the callback address by id

    -

    For listing all callback addresses with the same id we'll send HTTP request(GET) to /api/v1/merchant/callbacks/{id}

    -
      -
    • id - The id of the callback address
    • -
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -     "id":"56NVoGgbkPxStkhTjokV8E",
    -     "clientId":"AaXX9g2Zp99ij2cvLVymTN",
    -     "created":"2020-09-28T13:43:10.01129+00:00",
    -     "currencyId":4,
    -     "address":"0xbb050a0ab1e6a801ed6d2c7eac775737dea7d11e",
    -     "label":"testcallbacketh",
    -     "webhook":{
    -         "url":"https://google.com",
    -         "nativeCurrencyId":1
    -     }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ParameterDescription
    idThe unique id of the callback address
    clientIdThe merchant client this callback address is linked to
    createdThe timestamp of when the callback address was created
    currencyIdThe id of the currency the address is receiving
    addressThe actual deposit address
    labelThe display label of the callback address
    webhookThe webhook notification information and customizations
    - -

    Updating a callback address

    -

    For updating a callback address we'll send HTTP request(PUT) to /api/v1/merchant/callbacks/{id}

    -
      -
    • id - The id of the callback address
    • -
    -

    The request body should look like

    -
    {
    -    "clientId":"7aa5e7ba45d84d978c5ea7f62498abf4",
    -    "currencyId":4,
    -    "label":"testcallbacketh",
    -    "webhook":{
    -        "nativeCurrencyId":1,
    -        "url":"https://google.com"
    -    }
    -}
    -  
    -

    Request body explanation:

    - - - - - - - - - - - - - - - - - - - - -
    ParameterDescriptionRequired
    labelThe label of the address (display only)No
    webhookThe webhook notification information and customizationsNo
    -

    When a request sent successfully then the server will return a response which will contain the status 204(No content)

    - - - - -

    Listing all deposit transactions to callback addresses

    -

    For listing all deposit transactions to callback addresses, ordered newest first and optionally filtering by address, currency and date range we'll send HTTP request(GET) to /api/v1/merchant/callbacks/{id}

    -
      -
    • callbackId - The id of the callback address
    • -
    • currencyId -
    • -
    • from -
    • -
    • to -
    • -
    • after -
    • -
    • limit -
    • - -
    -

    When a request sent successfully then the server will return a response which will contain the next information

    -
    {
    -    "items":[{
    -        "id":"Dv1vDiDmfVrgSkEB2bLcUA",
    -        "created":"2020-09-25T08:36:23.470791+00:00",
    -        "completed":"2020-09-25T08:36:23.470793+00:00",
    -        "callbackAddressId":"JhmojzDdEJA8qJ4fF3zkT9",
    -        "address":"V7dHXKN6jKFXQrV3AKsYiePNezcgf7Cn2h",
    -        "currency":{
    -            "id":"33","symbol":"VLX",
    -            "name":"Velas","decimalPlaces":18},
    -            "nativeCurrency":{
    -                "id":"1",
    -                "symbol":"BTC",
    -                "name":"Bitcoin",
    -                "decimalPlaces":8
    -            },
    -            "amount":{
    -                "displayValue":"81.282438450358048310",
    -                "value":"81282438450358048310",
    -                "amount":"81282438450358048310",
    -                "currencyId":"0"
    -            },
    -            "coinPaymentsFee":{
    -                "displayValue":"0.406412192251790242",
    -                "value":"406412192251790242",
    -                "amount":"406412192251790242",
    -                "currencyId":"0"
    -            },
    -            "nativeAmount":{
    -                "displayValue":"0.00030505",
    -                "value":"30505",
    -                "amount":"30505",
    -                "currencyId":"1"
    -            },
    -            "nativeCoinPaymentsFee":{
    -                "displayValue":"0.00000153",
    -                "value":"153",
    -                "amount":"153",
    -                "currencyId":"1"
    -            },
    -            "status":"PaidOut"
    -        }],
    -        "paging":{
    -            "cursors":{
    -                "before":"xnPHFS5h2Ag=",
    -                "after":"TPRdkbdf2Ag="
    -            },
    -            "limit":100
    -        }
    -}
    -  
    -

    The response explanation:

    - - - - - - - - - - - - - - - - - - -
    ParameterDescription
    itemsInformation about callback address
    paging
    - - -
    -
    -
    - -