Skip to main content

Receive BTC onchain

The GraphQL endpoint to connect to:
A valid authentication token is required in the header as a bearer token:

Get the wallet IDs and check the balances

Can run this query at any stage to confirm the change in the balances.
The "BTC" wallet balance is denominated in satoshis.
The "USD" wallet balance is in cents.

The body of the GraphQL request

query Me {
  me {
    defaultAccount {
      wallets {
        id
        walletCurrency
        balance
      }
    }
  }
}
curl command to get the BTC wallet ID

Generate a new address to receive BTC

Receive satoshis to your BTC balance.
Use the address from the response and send to it from any bitcoin wallet.

The body of the GraphQL request

mutation onChainAddressCreate($input: OnChainAddressCreateInput!) {
  onChainAddressCreate(input: $input) {
    address
    errors {
      message
    }
  }
}
Set the BTC wallet ID:
curl command to generate a new address

Once paid check the balance again

The balance will be updated once the transaction is confirmed on the blockchain.
Until the confirmation the new incoming amount will show in the pendingIncomingBalance field.

The body of the GraphQL request

query Me {
  me {
    defaultAccount {
      wallets {
        walletCurrency
        balance
        pendingIncomingBalance
      }
    }
  }
}
curl command to check the balance of your wallets

To test the GraphQL requests further use the GraphQL playground at api.blink.sv/graphql for mainnet or api.staging.galoy.io/graphql for staging.
Check out the Galoy API Postman collection to find examples in multiple programming languages.