Skip to main content

Create Crypto Payment for Deposit Into the Wallet

The createChargeForDeposit mutation allows a user to create a cryptocurrency payment for a deposit into their wallet. It returns a deposit transaction with a deposit address.

Mutation: createChargeForDeposit

Schema:

createChargeForDeposit(
coin: String!,
network: String!,
cryptoType: String!
): CoinpaymentDepositTransaction

Parameters

  • coin (String): The currency to make the deposit (e.g., from Coinpayment). This field is mandatory.
  • network (String): The type of network (e.g., ERC20, BEP20, SOL). This field is mandatory.
  • cryptoType (String): The type of cryptocurrency. This field is mandatory.

Return

The mutation returns a CoinpaymentDepositTransaction object, which includes the deposit address and other transaction details.

Example Mutation

The following is an example of how to use the createChargeForDeposit mutation to create a cryptocurrency payment for a deposit into the wallet:

mutation {
createChargeForDeposit(
coin: "BTC",
network: "Bitcoin",
cryptoType: "Bitcoin"
) {
txnId,
userId,
coin,
network,
cryptoType,
depositAddress,
status,
createdAt,
updatedAt
}
}

Return

The example returns the CoinpaymentDepositTransaction object with details such as txnId, userId, coin, network, cryptoType, depositAddress, status, createdAt, and updatedAt.

In this example, the mutation initiates a cryptocurrency payment for a deposit using Bitcoin on the Bitcoin network. The return value includes the CoinpaymentDepositTransaction details such as the deposit address and transaction status.