Claim Cashback β pump.fun API
Use this endpoint to claim accumulated cashback from trades and creator fees from pump.fun and PumpSwap.
We claim cashback from trading in pools where cashbackEnabled = True, as well as creator fees from trades on tokens you created with cashbackToTradersEnabled = False (the default, no need to pass it when creating a token).
β
If you are planning to discard your account and switch to a new one β do not forget to call this function first.
It will return several rent fees (~0.004 SOL) to your wallet, even if you have not traded in pools with cashback enabled or created any tokens.
You can verify the refund on Solscan in the "Balance Changes" tab to confirm that the return was successfully processed.
β You do not need to provide a specific pool name β we do everything for you.
Local transactions are supported
For a local-transaction example, visit the Trade API page and reuse the same local-transaction code snippets β the flow works the same way here.
Endpointβ
POST https://api.pumpapi.io
Request Bodyβ
| Field | Description |
|---|---|
privateKey | Private key of the wallet that will sign the claim transaction |
action | Must be "claimCashback" |
priorityFee | Priority fee in SOL. |
π¦ Code Examplesβ
- Python
- JavaScript
- Rust
- Go
import requests
url = "https://api.pumpapi.io"
data = {
"privateKey": "private_key",
"action": "claimCashback",
"priorityFee": "0.0000012",
}
response = requests.post(url, json=data)
print(response.json())
import axios from "axios";
const url = "https://api.pumpapi.io";
const data = {
privateKey: "private_key",
action: "claimCashback",
priorityFee: "0.0000012",
};
axios
.post(url, data)
.then((res) => console.log(res.data))
.catch((err) => console.error(err));
use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client
.post("https://api.pumpapi.io")
.json(&json!({
"privateKey": "private_key",
"action": "claimCashback",
"priorityFee": "0.0000012"
}))
.send()
.await?
.text()
.await?;
println!("{}", res);
Ok(())
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.pumpapi.io"
data := map[string]any{
"privateKey": "private_key",
"action": "claimCashback",
"priorityFee": "0.0000012",
}
jsonData, _ := json.Marshal(data)
resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result any
_ = json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%v\n", result)
}