match2pay ## Sections • [Integrated systems](https://app.theneo.io/match-trade/match2pay/integrated-systems.md): List of CRMs already integrated with our Crypto Gateway Utip FX Back Office Skale Trade Smarter Kenmore design TradeSoft Nullpoint Plugit Axis (Broctagon) Reltrix Datalyst FTT (Fair Trading Technology) Leverate Pheasantech UpTrader Syntellicore (Dynamic Works) List of payment cashiers already integrated with our Crypto Gateway Paytiko Praxis BridgerPay Akurateco Corefy • [Crypto deposit flow](https://app.theneo.io/match-trade/match2pay/crypto-deposit-flow.md): The client requests a deposit in the broker’s Client Office. Client Office sends the request to the M2P. Processing request, generating individual crypto deposit wallet address. It is possible to assign generated wallet address to a particular trading account/client. Detailed guide can be found at the bottom. Returning generated crypto deposit wallet address on the payment page. If the client has a cryptocurrency, they can send this cryptocurrency to this individual deposit wallet address. The transaction is being processed by the blockchain. After receiving the information from the blockchain about a successfully processed transaction, the cryptocurrency is being booked on the deposit wallet address. Converting the cryptocurrency to FIAT. The final amount is being added to the broker’s M2P balance. The amount from a callback is being booked on the client’s trading account. • [Deposit Request](https://app.theneo.io/match-trade/match2pay/deposit-request.md): This request is responsible for generating a new deposit wallet address for cryptocurrency transactions and providing a link to the payment page. It is a valuable tool for users who wish to make a deposit or payment using cryptocurrencies. Important information: On live environment, there is a need to provide IP addresses to whitelist to be able to send requests Under one paymentID there can be more than one transaction. Deposit endpoint: /api/v2/deposit/crypto_agent HTTP method: POST Request content: JSON object Statuses of deposit requests Title Description NEW The transaction has been initiated (for example, the user displayed the wallet address to deposit) PENDING The transaction is processing. This status is temporary. It should change to DONE after receiving confirmation/response from the blockchain DECLINED The transaction has failed in the blockchain DONE The transaction is done. The funds are booked • [Multiple use of wallet address](https://app.theneo.io/match-trade/match2pay/multiple-use-of-wallet-address.md): In order to be able to accept multiple deposits to the same wallet address, the integration should be changed so that the payment_id of the generated request is assigned to a particular account on your end. The same payment_id should always be used/displayed for a specific account within the same crypto gateways. Within one payment_id there may be other deposits, which will have different hashes from the others but will still belong to the same payment_id. To sum up, the integration on your side should assume that the payment_id of the request may be repeated for deposits, but the transaction hash will be different, so if you receive a callback in which there is a hash with a new transaction it should be booked. This integration will have to be changed for each crypto payment gateway you use. Optionally, you can also add the ability to unlink the wallet address (payment_id) from the selected account so that it will be possible to generate a new wallet address in exceptional situations. • [Callbacks](https://app.theneo.io/match-trade/match2pay/callbacks.md): The first callback will be sent to you after the client makes a deposit Plain text { "depositAddress":"C9wic7ex7etARjPGQPKBHGLr2cRcCD17aZ", "cryptoTransactionInfo": [ { "txid":"b20feab400c3cd61a9d0daec8526d739a2335fe1900415f24835001e58a837a7", "confirmations":0, "amount":0.10000000, "status":"PENDING", "processingFee":0.00500000, "conversionRate":0 } ], "paymentId":"99ca8c34-5191-41d9-a1a2-666b9badf1ce", "status":"PENDING", "transactionAmount":0.10000000, "netAmount":0.09500000, "transactionCurrency":"BTC", "processingFee":0.00500000, "finalAmount":0, "finalCurrency":"USD", "conversionRate":0 } The second callback will be sent to you after the funds are correctly booked Plain text { "depositAddress":"C9wic7ex7etARjPGQPKBHGLr2cRcCD17aZ", "cryptoTransactionInfo": [ { "txid":"b20feab400c3cd61a9d0daec8526d739a2335fe1900415f24835001e58a837a7", "confirmations":2, "amount":0.10000000, "confirmedTime":"Mar 20, 2019 7:06:38PM", "status":"DONE", "processingFee":0.00500000, "conversionRate":3198.64800 } ], "paymentId":"99ca8c34-5191-41d9-a1a2-666b9badf1ce", "status":"DONE", "transactionAmount":0.10000000, "netAmount":0.09500000, "transactionCurrency":"BTC", "processingFee":0.00500000, "finalAmount":303.87, "finalCurrency":"USD", "conversionRate":3198.65 } Fields Title Description depositAddress Cryptocurrency wallet address txid Blockchain id of the transaction (can be used to check the transaction status in the blockchain) confirmations Number of transaction confirmations amount Deposited amount status Transaction status processingFee Charged fee amount conversionRate Conversion rate from transactionCurrency to finalCurrency paymentId Unique id of the payment transaction in the Match2Pay transactionAmount Value of transactions in the transactions currency That value should NOT be used to book deposits netAmount transactionAmount after processsing fee deduction finalAmount Amount sum of confirmed transactions finalCurrency Currency in which we will return the finalAmount • [Withdrawal Request](https://app.theneo.io/match-trade/match2pay/withdrawal-request.md): A withdrawal request is a fundamental process that facilitates the transfer of cryptocurrency funds from one's wallet to an external recipient's address. Endpoint: /api/v2/withdraw/crypto_agent HTTP method: POST Request Content: JSON Object Statuses of withdrawal requests Title Description NEW The transaction has been initiated ADMIN CONFIRMATION The transactions need to be confirmed by Support PENDING The transaction is processing. This status is temporary. It should change to DONE or DECLINED after receiving confirmation/response from the blockchain DECLINED The transaction has failed. This status is not final – it can be reprocessed within the same paymentID DONE The transaction is done. The funds are booked • [Cryptocurrency details](https://app.theneo.io/match-trade/match2pay/cryptocurrency-details.md): Please make sure you send cryptocurrency from the list below and use a network supported by Match2pay. Sending funds via an unsupported token or network may result in loss of funds. Title Description Title cryptocurrency paymentCurrency or withdrawCurrency paymentGatewayName Bitcoin BTC BTC Ethereum (only Ethereum network) ETH ETH USDT ERC20 (only Ethereum network) min amount 5 USDT! UST USDT ERC20 Coinbase Wrapped BTC ERC20 [Deposits only] CTC CBBTC ERC20 USDC ERC20 (only Ethereum network) min amount 5 USDC! UCC USDC ERC20 SHIBA INU ERC20 [Deposits only] SHB SHIBA INU ERC20 Tronix - TRX [Deposits only] min amount 1.5 TRX! TRX TRX USDT TRC20 - min amount 1 USDT! USX USDT TRC20 Binance Coin (only BSC network) BNB BNB USDT BEP20 (only BSC network) USB USDT BEP20 USDC BEP20 (only BSC network) UCB USDC BEP20 BTC BEP20 [Deposits only] BTB BTC BEP20 MATIC [Deposits only] MAT MATIC USDT Polygon USP USDT POLYGON USDC Polygon [Deposits only] UCP USDC POLYGON XRP [Deposits only] XRP XRP Dogecoin DOG DOGECOIN Litecoin LTC LTC Solana SOL SOL USDT Solana USS USDT SOL USDC Solana UCS USDC SOL Toncoin (TON)* [Deposits only] TON TON USDT TON* [Deposits only] UTT USDT TON ETH BASE [Deposits only] BST ETH BASE USDC BASE UBC USDC BASE ETH OPTIMISM [Deposits only] ETO ETH OPTIMISM USDT OPTIMISM UTO USDT OPTIMISM USDC OPTIMISM UCO USDC OPTIMISM ETH ARBITRUM [Deposits only] ETA ETH ARBITRUM USDT ARBITRUM UTA USDT ARBITRUM USDC ARBITRUM UCA USDC ARBITRUM For withdrawals , there are 3 types of BTC addresses supported by our system: Legacy – starting with “1” Script – starting with “3” Segwit – starting with “bc1q” For the test environment, we provide Bitcoin and USDT TRC20 gateways. TON Blockchain To deposit using the TON blockchain via Match2Pay, you must include a memo. The deposit request will generate a wallet address and memo in the format walletAddress;memo (separated by a ;) Important: Failing to include the memo may result in a loss of funds! For withdrawals, Match2Pay supports both options: with or without a memo. To withdraw without a memo, simply enter the wallet address as usual. If a memo is required, use the format walletAddress;memo , for example: "address": "UQANXiRA9BhsOAcuaQ30L7W2StlboH2p9_eOxf4VB1ohz0v6;1708317974" • [Signature](https://app.theneo.io/match-trade/match2pay/signature.md): All signatures are valid for one minute after creation. API token and API secret key are provided by Match-Trade. Algorithm Take all the keys from your deposit or withdrawal request and sort them in A-Z order Concatenate the values according to the order of keys from the first step Append the API secret key to the concatenated string from the second step Build the sha384 hash of the string from the third step Example API secret key: MhB6KV2bVlhN6Nud8MRGKQaBTHmwOlgG2Pgj Select... { "apiToken" : "b3RJ4qBRai129psUfrbGisnE5wpaMaFvovQS", "callbackUrl" : "http://test.com", "currency" : "USD", "paymentCurrency" : "BTC", "timestamp" : "1566214818" } The string from this request body is: b3RJ4qBRai129psUfrbGisnE5wpaMaFvovQShttp://test.comUSDBTC1566214818 Then we append the secret key at the end and we receive: b3RJ4qBRai129psUfrbGisnE5wpaMaFvovQShttp://test.comUSDBTC1566214818MhB6KV2bVlhN6Nud8MRGKQaBTHmwOlgG2Pgj Then we use sha-384 to generate a hash from this string and we receive our final signature value: 1e0e1de03c8f00177f689cef9e48a9cefab5deb2f572eb578e719ccf2b7f526758ae5aca12b0433d2812908e233a2325 Please remember that signature must have lowercase letters . We add it to the request body in the signature field. The final request body is: Select... { "apiToken" : "b3RJ4qBRai129psUfrbGisnE5wpaMaFvovQS", "callbackUrl" : "http://test.com", "currency" : "USD", "paymentCurrency" : "BTC", "signature":"1e0e1de03c8f00177f689cef9e48a9cefab5deb2f572eb578e719ccf2b7f526758ae5aca12b0433d2812908e233a2325", "timestamp" : "1566214818" } • [Callback signature generation](https://app.theneo.io/match-trade/match2pay/callback-signature-generation.md): Important note : Callback signature should only be validated for status DONE To ensure that callback comes from match2pay system you can optionally check the callback signature. To do this you have to build the sha384 hash by adding the content of callback in following order: “transactionAmount” + “transactionCurrency” + “status” + “apitoken” + “apisecret” It’s important to mention that signature will be recieved in Headers Example: In this case "transactionAmount" + "transactionCurrency" + "status" string will look like this: 0.00011873BTCDONE +"apitoken"+"apisecret" amount = 0.00011873 transactionCurrency = BTC status = DONE apitoken = provided by Support apisecret = provided by Support In case when(USX for Example): "amount": 1, you have to add .00000000 to the amount. Beginning of string should looks like this: 1.00000000USXDONE "amount" should allways have 8 decimal places in string to generate signature.