Donate

These endpoints are used to initiate a donation to a nonprofit supported by Givepact. EINs of our nonprofits can be found by searching our site on https://app.givepact.io/gallery. Tax receipts are issued if an only if the email and name of the person is included in their respective fields of the payload. Each address is single use!

Endpoints

POST https://api.givepact.io/v1/donate

POST https://api.givepact.io/v1/batch_donate

JSON Payload

Donor Name and Donor Email must be both present or both absent!
NameTypeDescriptionOptional
EinStringThe EIN of the NPO you wish to donate to.False
AssetStringName of the digital asset being donated.False
NetworkStringBlockchain network of the digital asset being donated.False
Share DataBoolConsent to data sharing with the NPO you are donating to.False
Donor NameStringName of donor on tax receipt.True
Donor EmailStringEmail of donor for tax receipt.True

Batching Donations

If you are initializing donations with multiple assets or EINs, you will need to submit an array of the object described in the preceding section and use the batch_donation endpoint.

Responses

200
Responses from `batch_donate` will be an array of the JSON object below.
NameDescriptionType
einStringThe EIN of the NPO that the deposit address is reserved for
addressStringThe deposit address for the donation
assetStringThe asset which is expected by this deposit address
networkStringThe blockchain network where the address and asset needs to be
500

Plaintext response with error message

Expected Values for Asset and Network

Name: Uniswap, Network: Ethereum

Name: BasicAttentionToken, Network: Ethereum

Name: EthereumClassic, Network: EthereumClassic

Name: Avalanche, Network: Avalanche 

Name: Cosmos, Network: Cosmos

Name: USDT, Network: Ethereum

Name: Ox, Network: Ethereum

Name: USDC, Network: Ethereum

Name: Decentraland, Network: Ethereum

Name: Xyo, Network: Ethereum

Name: Chainlink, Network: Ethereum

Name: Algorand, Network: Algorand

Name: BitcoinSatoshiVision, Network: BitcoinSatoshiVision

Name: Compound, Network: Ethereum

Name: USDollar, Network: None

Name: Bitcoin, Network: Bitcoin,

Name: Ether, Network: Ethereum

Name: SUKU, Network: Ethereum 

Name: Polkadot, Network: Polkadot

Name: Raven, Network: Raven

Name: Maker, Network: Ethereum

Name: Near, Network: Near

Name: Paxos, Network: Ethereum

Name: Dogecoin, Network: Dogecoin

Name: BitcoinCash, Network: BitcoinCash

Name: Ripple, Network: Ripple

Name: WrappedBitcoin, Network: Ethereum

Name: Litecoin, Network: Litecoin

Name: Cardano, Network: Cardano

Name: Filecoin, Network: Filecoin

Name: Polygon, Network: Ethereum

Name: Aave, Network: Ethereum

Name: Gala, Network: Ethereum

Name: DAI, Network: Ethereum 

Name: Fantom, Network: Fantom 

Name: SushiSwap, Network: Ethereum

Name: Solana, Network: Solana

Name: Mobilecoin, Network: Mobilecoin 

Name: ShibaInu, Network: Ethereum 

Name: YearnFinance, Network: Ethereum

Name: BinanceUSD, Network: Ethereum 

Name: TheSandbox, Network: Ethereum

Name: Xlm, Network: Stellar

Name: Pepe, Network: Ethereum

Examples

#use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
#pub struct DonationInfoWithTaxReceipt {
   pub ein: String,
   pub asset: String,
   pub share_donor_data_with_npo: bool,
   pub donor_name: String,
   pub donor_email: String,
   pub network: String,
#}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let donation_info = DonationInfoWithTaxReceipt {
        ein: "741109745".to_string(),
        asset: "Ether".to_string(),
        share_donor_data_with_npo: false,
        donor_name: "Jack Smith",
        donor_email: "example_email@givepact.io",
        network: "Ethereum".to_string(),
    };
    let res = reqwest::Client::new()
        .post("https://api.givepact.io/v1/batch_donate")
        .json(&[donation_info])
        .send()
        .await?
        .text()
        .await?;

    Ok(())
#}