> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useroutr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Crowdfunding and tips

> Let backers support a campaign or a creator with whatever token they hold, settled straight to the campaign's own account.

![Backers give DAI on Arbitrum, ETH on Base or XLM, and the campaign's progress bar fills.](https://mintcdn.com/thirtn/tEtIKPxuXx_PTNHq/images/illustrations/use-case-crowdfunding-light.svg?fit=max\&auto=format\&n=tEtIKPxuXx_PTNHq\&q=85\&s=afddbbbb240e73e0418d2d4738e36394)

Funding intentsPer-intent destinationHosted checkout

## The idea

A backer loves your community garden campaign. They also hold DAI on Arbitrum and nothing else.
That should not be the end of the story. Let them back it with what they have, and send the money
straight to the campaign's own account while your progress bar fills up.

## How it plays out

**1. A backer pledges**

They choose an amount. Your server creates a funding intent whose `destination` is the
campaign's own Stellar account.

**2. They pay with what they hold**

Send them to the [hosted checkout](https://docs.useroutr.com/payments/hosted-checkout.md), or share its link: it works on
any device and needs no frontend code.

**3. The bar moves**

On `funding.credited`, add the pledge to the campaign's total and thank the backer. The value
has already settled to the campaign's account.

## The code

```ts Take a pledge theme={null}
const intent = await useroutr.fundingIntents.create(
  {
    amount: pledge.amount,
    asset: "asset_usdc_stellar",
    destination: {
      network: "stellar",
      asset: "asset_usdc_stellar",
      address: campaign.stellarAddress,
    },
    reference: pledge.id,
    metadata: { campaign_id: campaign.id },
  },
  { idempotencyKey: pledge.id },
);

redirect(intent.hosted_funding_url!);
```

```ts Count it theme={null}
// Inside your webhook handler, after verifying the event
if (event.type === "funding.credited") {
  const pledge = event.data.object;
  await addToCampaign({
    campaignId: String(pledge.metadata.campaign_id),
    amount: pledge.requirement.amount,
    pledgeId: pledge.reference, // count each pledge once: deliveries can repeat
  });
}
```

## Make it your own

* **Tip jars.** Three buttons, 1, 5 and 10 USDC, each creating an intent for a creator's own
  account. Same code, smaller numbers.
* **Stretch goals.** Your totals come from `funding.credited`, so unlocking a stretch goal is a
  check after each one.
* **Back it from anywhere.** Backers on Base, Arbitrum or Ethereum pay the same link; the route
  bridges their payment and converts it.

## Good to know

* The campaign's account must exist and, for USDC, hold a USDC
  [trustline](https://docs.useroutr.com/stellar-basics.md#trustlines). Useroutr checks before anyone pays and refuses the
  intent with `INVALID_DESTINATION` otherwise, so check it when a campaign signs up.
* An intent settles to one destination. If your platform takes a fee, settle to your own account
  and pay campaigns out yourself, or collect the fee separately.
* Pledges are exact amounts. A backer who sends more gets the extra back automatically; see
  [Refunds](https://docs.useroutr.com/guides/refunds.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.