Receive BTC onchain
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
}
}
}
}
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
}
}
}
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.
There are multiple ways to get notified on the incoming payments: see how to use webhooks (callbacks) and websocket subscriptions.
The body of the GraphQL request to check the balance including pendingIncomingBalance
query Me {
me {
defaultAccount {
wallets {
walletCurrency
balance
pendingIncomingBalance
}
}
}
}
To test the GraphQL requests further use the GraphQL playground at api.blink.sv/graphql for mainnet or api.staging.blink.sv/graphql for staging.
Check out the Galoy API Postman collection to find examples in multiple programming languages.