Crypto Internal Transfer

Overview

In the offramp process, there may be scenarios where a merchant’s crypto assets are held in a Saber pool account and need to be transferred to a user's wallet on Saber for offramps. Saber provides APIs to facilitate internal transfers, ensuring seamless and secure movement of funds within the Saber ecosystem.

To set up a pool account, get in touch with the Saber team.


1. Initiate an Internal Transfer

This API transfers crypto from a merchant's pool account to a user's wallet on Saber.

Endpoint: https://mudrex.com/api/v1/wallet/internal_transfer
Method: POST

Request Parameters

FieldTypeDescription
to_user_idStringThe ID of the user receiving the crypto.
from_user_idStringThe ID of the user (merchant’s pool account) sending the crypto.
assetStringThe cryptocurrency to be transferred (e.g., USDT).
amountFloatThe amount of cryptocurrency to transfer.

Sample Request

curl --location 'https://mudrex.com/api/v1/wallet/internal_transfer' \
--header 'X-Timestamp: {{timestamp}}' \
--header 'X-Client-Id: CLIENT_ID_HERE' \
--header 'X-Request-Id: REQUEST_ID_HERE' \
--header 'X-Secret-Key: SECRET_KEY_HERE' \
--header 'X-User-Id: USER_ID_HERE' \
--data '{
    "to_user_id": "950627dd-e729-49f7-bb13-5f0341871437",
    "from_user_id": "f7468ef2-fa11-49ed-b154-0dd37943ca92",
    "asset": "USDT",
    "amount": 5
}'

Sample Response

{
  "success": true,
  "data": {
    "transaction_id": "483aed11-3227-4f35-9737-94188aff6be2"
  }
}

2. Fetch Single Asset Internal Transfer History

This API fetches the internal transfer history for a specific asset (e.g., USDT).

Endpoint: https://mudrex.com/api/v1/wallet/internal_transfer/history/{asset}
Method: GET

Sample Request

curl --location 'https://mudrex.com/api/v1/wallet/internal_transfer/history/USDT' \
--header 'X-Timestamp: {{timestamp}}' \
--header 'X-Client-Id: CLIENT_ID_HERE' \
--header 'X-Request-Id: REQUEST_ID_HERE' \
--header 'X-Secret-Key: SECRET_KEY_HERE' \
--header 'X-User-Id: USER_ID_HERE'

Sample Response

{
  "success": true,
  "data": [
    {
      "amount": 20,
      "transaction_id": 2888,
      "transaction_reference": "d63d675fffa641809cd4cb7c1e4311ff",
      "balance": 30,
      "is_debit": true
    },
    {
      "amount": 20,
      "transaction_id": 2889,
      "transaction_reference": "d63d675fffa641809cd4cb7c1e4311ff",
      "balance": 50,
      "is_debit": false
    }
  ]
}

3. Fetch All Internal Transfer History

This API retrieves the history of all internal transfers, regardless of the asset type.

Endpoint: https://mudrex.com/api/v1/wallet/internal_transfer/history/
Method: GET

Sample Request

curl --location 'https://mudrex.com/api/v1/wallet/internal_transfer/history/' \
--header 'X-Timestamp: {{timestamp}}' \
--header 'X-Client-Id: CLIENT_ID_HERE' \
--header 'X-Request-Id: REQUEST_ID_HERE' \
--header 'X-Secret-Key: SECRET_KEY_HERE' \
--header 'X-User-Id: USER_ID_HERE'

Sample Response

{
  "success": true,
  "data": [
    {
      "transaction_id": 3031,
      "transaction_reference": "214241f0fcdb43ca8e8f14abe1f05991",
      "balance": 23,
      "is_debit": true
    },
    {
      "transaction_id": 3029,
      "transaction_reference": "214241f0fcdb43ca8e8f14abe1f05990",
      "balance": 24,
      "is_debit": true
    }
  ]
}

Use Cases

  1. Internal Transfer Initiation:

    • Move crypto from a merchant’s pool account to a user account on Saber to facilitate off-ramp transactions.
  2. Asset-Specific History:

    • Retrieve transaction history for a specific cryptocurrency to monitor activity and resolve discrepancies.
  3. General Transfer Monitoring:

    • Access the complete history of all internal transfers for audits and reconciliations.

Key Notes

  • Secure Transfers: Internal transfers stay within the Saber system, ensuring high reliability and security.
  • Efficiency: Supports seamless crypto movement for quick settlement and off-ramp execution.
  • Audit-Friendly: Detailed transaction history APIs enable transparency and operational insights.

These APIs form a critical part of the offramp workflow, allowing merchants to efficiently manage crypto movements while ensuring compliance and accuracy. For further details, refer to the API reference here.